return null for undefined storage key

This commit is contained in:
Kyle Spearrin 2018-06-01 11:51:48 -04:00
parent e0d5a4d8b7
commit c512b9b3ce
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ export class LowdbStorageService implements StorageService {
get<T>(key: string): Promise<T> {
const val = this.db.get(key).value();
if (val == null) {
return Promise.resolve(null);
}
return Promise.resolve(val as T);
}