bin scripts: compare against null, not undefined

This commit is contained in:
Richard Hansen 2021-01-08 17:47:38 -05:00 committed by John McLear
parent 5bcd6f44a5
commit f03c4bd7f7
3 changed files with 7 additions and 9 deletions

View file

@ -59,12 +59,12 @@ npm.load({}, async () => {
}
// check if the pad has a pool
if (pad.pool === undefined) throw new Error('Attribute pool is missing');
if (pad.pool == null) throw new Error('Attribute pool is missing');
// check if there is an atext in the keyRevisions
if (revisions[keyRev] === undefined ||
revisions[keyRev].meta === undefined ||
revisions[keyRev].meta.atext === undefined) {
if (revisions[keyRev] == null ||
revisions[keyRev].meta == null ||
revisions[keyRev].meta.atext == null) {
console.error(`No atext in key revision ${keyRev}`);
continue;
}