Skip to content

Commit bf4bde8

Browse files
committed
Get Method Returns null if table does not exists
1 parent cd01fd8 commit bf4bde8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

structures/methods/get.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ module.exports = async function(table, key){
77
if(!table || typeof table !== "string") throw new TypeError(errors.table.replace("{received}", typeof table));
88
if(!key || typeof key !== "string") throw new TypeError(errors.key.replace("{received}", typeof key));
99

10+
let tables = await this.tables();
11+
if(!tables.includes(table)) return null;
12+
1013
let keys = key.split('.'),
1114
keys2 = key.split('.');
1215
if(keys.length > 1){

0 commit comments

Comments
 (0)