mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
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
1 changed files with 2 additions and 2 deletions
|
|
@ -145,12 +145,12 @@ function renderData(data, depth = 0) {
|
|||
}
|
||||
return out.join('\n');
|
||||
}
|
||||
if ( typeof data !== 'object' ) {
|
||||
if ( typeof data !== 'object' || data === null ) {
|
||||
return `${indent}${data}`;
|
||||
}
|
||||
const out = [];
|
||||
for ( const [ name, value ] of Object.entries(data) ) {
|
||||
if ( typeof value === 'object' ) {
|
||||
if ( typeof value === 'object' && value !== null ) {
|
||||
out.push(`${indent}${name}:`);
|
||||
out.push(renderData(value, depth + 1));
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue