Skip to content

Handle DOM/JSON edge cases - #67

Merged
takezoe merged 2 commits into
gitbucket:masterfrom
aadrian:pr-dom-json-edge-cases
Sep 19, 2026
Merged

takezoe merged 2 commits into
gitbucket:masterfrom
aadrian:pr-dom-json-edge-cases

Conversation

@aadrian

@aadrian aadrian commented Sep 17, 2026

Copy link
Copy Markdown
Member

Adds null-checks and try/catch around DOM lookups and JSON.parse in the explorer sidebar. Split out of #64 per review request.

const logo = document.querySelector('header.main-header a.logo');
if (!logo) {
return;
}

@takezoe takezoe Sep 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge this PR because it won't degrade anything.

However, I think this guard doesn't work as expected in the first place because <Root /> is already added at this point. It should be checked index.js before adding it.

@takezoe
takezoe merged commit c753c3b into gitbucket:master Sep 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants