From c8253f0e64e117c69ef52f140478bbade3ea7c0d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Dec 2018 04:32:41 +0300 Subject: [PATCH] Article.openInNewWindow: do not crash if window is null --- js/Article.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/Article.js b/js/Article.js index b91501faf..c3b6766c8 100644 --- a/js/Article.js +++ b/js/Article.js @@ -109,10 +109,13 @@ define(["dojo/_base/declare"], function (declare) { }, openInNewWindow: function (id) { const w = window.open(""); - w.opener = null; - w.location = "backend.php?op=article&method=redirect&id=" + id; - Headlines.toggleUnread(id, 0); + if (w) { + w.opener = null; + w.location = "backend.php?op=article&method=redirect&id=" + id; + + Headlines.toggleUnread(id, 0); + } }, render: function (article) { App.cleanupMemory("content-insert");