mirror of https://github.com/gorhill/uBlock.git
Reminder that `typeof null` is 'object'
Related feedback: - https://github.com/uBlockOrigin/uBlock-issues/discussions/2619#discussioncomment-5757274
This commit is contained in:
parent
c31e087946
commit
536bfb3387
|
@ -145,12 +145,12 @@ function renderData(data, depth = 0) {
|
||||||
}
|
}
|
||||||
return out.join('\n');
|
return out.join('\n');
|
||||||
}
|
}
|
||||||
if ( typeof data !== 'object' ) {
|
if ( typeof data !== 'object' || data === null ) {
|
||||||
return `${indent}${data}`;
|
return `${indent}${data}`;
|
||||||
}
|
}
|
||||||
const out = [];
|
const out = [];
|
||||||
for ( const [ name, value ] of Object.entries(data) ) {
|
for ( const [ name, value ] of Object.entries(data) ) {
|
||||||
if ( typeof value === 'object' ) {
|
if ( typeof value === 'object' && value !== null ) {
|
||||||
out.push(`${indent}${name}:`);
|
out.push(`${indent}${name}:`);
|
||||||
out.push(renderData(value, depth + 1));
|
out.push(renderData(value, depth + 1));
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue