From e7509af2b2fad6ab23ea07e6e46e88a4ee0d03f1 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 25 Jul 2012 12:29:16 -0700 Subject: adding null check for currentDocument to prevent error Signed-off-by: Ananya Sen --- .../ui/code-editor-view-options.reel/code-editor-view-options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/code-editor') diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js index 70d033fb..2ca6118b 100644 --- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js +++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js @@ -53,7 +53,7 @@ exports.CodeEditorViewOptions = Montage.create(Component, { if(!value || (this._currentDocument.currentView === "design")) { this.visible = false; - } else if(this._currentDocument.currentView === "code") { + } else if(this._currentDocument && this._currentDocument.currentView === "code") { if(this._currentDocument.model.views.design){//code view of design document this.application.ninja.editorViewOptions.visible = false; -- cgit v1.2.3