Skip to content

Commit d6df2b8

Browse files
authored
fix: Cannot read property 'classList' of null (#1527)
* fix: Cannot read property 'classList' of null * fix: Cannot read property classList of null #1527 (comment)
1 parent b8653e1 commit d6df2b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plugins/search/component.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ function doSearch(value) {
137137
$panel.innerHTML = '';
138138

139139
if (options.hideOtherSidebarContent) {
140-
$sidebarNav.classList.remove('hide');
141-
$appName.classList.remove('hide');
140+
$sidebarNav && $sidebarNav.classList.remove('hide');
141+
$appName && $appName.classList.remove('hide');
142142
}
143143

144144
return;
@@ -160,8 +160,8 @@ function doSearch(value) {
160160
$clearBtn.classList.add('show');
161161
$panel.innerHTML = html || `<p class="empty">${NO_DATA_TEXT}</p>`;
162162
if (options.hideOtherSidebarContent) {
163-
$sidebarNav.classList.add('hide');
164-
$appName.classList.add('hide');
163+
$sidebarNav && $sidebarNav.classList.add('hide');
164+
$appName && $appName.classList.add('hide');
165165
}
166166
}
167167

0 commit comments

Comments
 (0)