From 952399c26ee204f6d5467d1385558dee44b192dc Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Thu, 29 Apr 2021 20:44:47 +0000 Subject: [PATCH] fix(core): update --- ts/smartnpm.classes.registrycache.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ts/smartnpm.classes.registrycache.ts b/ts/smartnpm.classes.registrycache.ts index 5493d06..3017aee 100644 --- a/ts/smartnpm.classes.registrycache.ts +++ b/ts/smartnpm.classes.registrycache.ts @@ -22,9 +22,11 @@ export class RegistryCache { } public async cacheSmartFile (fileIdArg: string, smartfileArg: plugins.smartfile.Smartfile) { - await this.levelCache.storeCacheEntryByKey(fileIdArg, new plugins.levelcache.CacheEntry({ - contents: Buffer.from(smartfileArg.foldToJson()), - ttl: 60000 - })); + if (smartfileArg) { + await this.levelCache.storeCacheEntryByKey(fileIdArg, new plugins.levelcache.CacheEntry({ + contents: Buffer.from(smartfileArg.foldToJson()), + ttl: 60000 + })); + } } } \ No newline at end of file