diff --git a/admin/javascript/LeftAndMain.Preview.js b/admin/javascript/LeftAndMain.Preview.js index 0d23d18a9..d3cc0f520 100644 --- a/admin/javascript/LeftAndMain.Preview.js +++ b/admin/javascript/LeftAndMain.Preview.js @@ -452,9 +452,11 @@ // No state available at all. this.setCurrentStateName(null); } - + // Mark url as a preview url so it can get special treatment - url += ((url.indexOf('?') === -1) ? '?' : '&') + 'CMSPreview=1'; + if (url) { + url += ((url.indexOf('?') === -1) ? '?' : '&') + 'CMSPreview=1'; + } // If this preview panel isn't visible at the moment, delay loading the URL until it (maybe) is later if (this.is('.column-hidden')) {