Skip to content

Commit ce814e6

Browse files
committed
Improved behaviour for null state values.
Signed-off-by: Grant Skinner <[email protected]>
1 parent d10cdab commit ce814e6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

js/views/DocView.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,9 @@ p.showTool = function(tool) {
362362
};
363363

364364
p.setState = function (state) {
365-
if (!state) { return; }
366-
this.replaceCM.setValue(state.replace);
367-
this.listCM.setValue(state.list);
368-
this.showTool(state.tool);
365+
this.replaceCM.setValue((state && state.replace) || DocView.DEFAULT_REPLACE);
366+
this.listCM.setValue((state && state.list) || DocView.DEFAULT_LIST);
367+
this.showTool(state && state.tool);
369368
};
370369

371370
/** Unused

0 commit comments

Comments
 (0)