Skip to content

Commit

Permalink
Add an early return for undefined rows
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Feb 15, 2024
1 parent 4f12547 commit a774228
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/storage/providers/SQLiteStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ db.execute('PRAGMA journal_mode=WAL;');
const provider: StorageProvider = {
getItem(key) {
return db.executeAsync('SELECT record_key, valueJSON FROM keyvaluepairs WHERE record_key = ?;', [key]).then(({rows}) => {
if (rows?.length === 0) {
if (!rows || rows?.length === 0) {
return null;
}
const result = rows?.item(0);
Expand Down

0 comments on commit a774228

Please sign in to comment.