Skip to content

Commit

Permalink
Fix WbView crashing when navigating with "Results" open
Browse files Browse the repository at this point in the history
Fixes #1898
  • Loading branch information
maxpatiiuk committed Jul 26, 2022
1 parent 750134f commit 8336fd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion specifyweb/frontend/js_src/lib/wbview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,7 @@ const WBView = Backbone.View.extend({
this.getHotPlugin('hiddenColumns').hideColumns(colsToHide);
});
effectsCleanup.push(() => {
if(this.hot === undefined) return;
this.getHotPlugin('hiddenRows').showRows(
rowsToHide.filter((visualRow) => !initialHiddenRows.includes(visualRow))
);
Expand Down Expand Up @@ -1822,7 +1823,7 @@ const WBView = Backbone.View.extend({
const runCleanup = () =>
// If WBView.remove() was called, this.hot would be undefined here
[...effectsCleanup, this.hot?.render.bind(this.hot)].forEach(
(effectCleanup) => effectCleanup()
(effectCleanup) => effectCleanup?.()
);

const handleClose = () => {
Expand Down

0 comments on commit 8336fd8

Please sign in to comment.