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 --- js/controllers/styles-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/controllers') diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 0e1df1e9..e95c6614 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -131,7 +131,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { handleChange: { value: function(notification) { if(notification.currentPropertyPath === "model.currentViewIdentifier") { - if(this.currentDocument.model.currentView.identifier === "design") { + if(this.currentDocument && this.currentDocument.model.currentView.identifier === "design") { ///// Stage stylesheet should always be found this._stageStylesheet = this.getSheetFromElement(this.CONST.STAGE_SHEET_ID); // Returns null if sheet not found (as in non-ninja projects) -- cgit v1.2.3