In the clean-repo-sidebar feature, the following code (source link) was introduced to the moveReportLink function in #6500 to select the "Report repository" button, which is used afterwards to move it to the bottom of the sidebar:
However, the code throws an error due to the non-null assertion operator when the select function above returns an null value in repositories owned by the user (see figures below) where report link does not exist.
Description
In the
clean-repo-sidebar
feature, the following code (source link) was introduced to themoveReportLink function
in #6500 to select the "Report repository" button, which is used afterwards to move it to the bottom of the sidebar:const reportLink = select('.Layout-sidebar a[href^="/contact/report-content"]')!.parentElement!;
However, the code throws an error due to the non-null assertion operator when the
select
function above returns an null value in repositories owned by the user (see figures below) where report link does not exist.How to replicate the issue + URL
Figure 1 The error occurs in a repository home page where the report button does not exist
Figure 2 The same issue, on Firefox
Extension version
23.5.10
Browser(s) used
all supported browsers