Skip to content

Commit 32400bd

Browse files
committed
Avoid one particular JavaScript error
1 parent 8987d1d commit 32400bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

debug_toolbar/static/debug_toolbar/js/toolbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@
155155
e.classList.add('djSelected');
156156
e.classList.remove('djUnselected');
157157
self.textContent = self.getAttribute('data-toggle-close');
158-
e.querySelector('.djToggleSwitch').textContent = self.textContent;
159158
} else {
160159
e.classList.remove('djSelected');
161160
e.classList.add('djUnselected');
162161
self.textContent = self.getAttribute('data-toggle-open');
163-
e.querySelector('.djToggleSwitch').textContent = self.textContent;
164162
}
163+
var switch_ = e.querySelector('.djToggleSwitch')
164+
if (switch_) switch_.textContent = self.textContent;
165165
});
166166
});
167167

0 commit comments

Comments
 (0)