mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
bin scripts: compare against null, not undefined
This commit is contained in:
parent
5bcd6f44a5
commit
f03c4bd7f7
3 changed files with 7 additions and 9 deletions
|
@ -30,7 +30,7 @@ npm.load({}, async () => {
|
||||||
const pad = await padManager.getPad(padId);
|
const pad = await padManager.getPad(padId);
|
||||||
|
|
||||||
// check if the pad has a pool
|
// check if the pad has a pool
|
||||||
if (pad.pool === undefined) {
|
if (pad.pool == null) {
|
||||||
console.error(`[${pad.id}] Missing attribute pool`);
|
console.error(`[${pad.id}] Missing attribute pool`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ npm.load({}, async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if there is a atext in the keyRevisions
|
// check if there is a atext in the keyRevisions
|
||||||
if (revisions[keyRev].meta === undefined || revisions[keyRev].meta.atext === undefined) {
|
if (revisions[keyRev].meta == null || revisions[keyRev].meta.atext == null) {
|
||||||
console.error(`[${pad.id}] Missing atext in revision ${keyRev}`);
|
console.error(`[${pad.id}] Missing atext in revision ${keyRev}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,12 +59,12 @@ npm.load({}, async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the pad has a pool
|
// 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
|
// check if there is an atext in the keyRevisions
|
||||||
if (revisions[keyRev] === undefined ||
|
if (revisions[keyRev] == null ||
|
||||||
revisions[keyRev].meta === undefined ||
|
revisions[keyRev].meta == null ||
|
||||||
revisions[keyRev].meta.atext === undefined) {
|
revisions[keyRev].meta.atext == null) {
|
||||||
console.error(`No atext in key revision ${keyRev}`);
|
console.error(`No atext in key revision ${keyRev}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,7 @@ npm.load({}, async () => {
|
||||||
const revision = await db.get(`pad:${padId}:revs:${revNum}`);
|
const revision = await db.get(`pad:${padId}:revs:${revNum}`);
|
||||||
// check if there is a atext in the keyRevisions
|
// check if there is a atext in the keyRevisions
|
||||||
if (~keyRevisions.indexOf(revNum) &&
|
if (~keyRevisions.indexOf(revNum) &&
|
||||||
(revision === undefined ||
|
(revision == null || revision.meta == null || revision.meta.atext == null)) {
|
||||||
revision.meta === undefined ||
|
|
||||||
revision.meta.atext === undefined)) {
|
|
||||||
console.error(`No atext in key revision ${revNum}`);
|
console.error(`No atext in key revision ${revNum}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue