summaryrefslogtreecommitdiff
path: root/js/Article.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-09 04:32:41 +0300
committerAndrew Dolgov <[email protected]>2018-12-09 04:32:41 +0300
commitc8253f0e64e117c69ef52f140478bbade3ea7c0d (patch)
tree3711c7ede58e7342637dd3c6d237b6e42e3d9477 /js/Article.js
parent8f5b5ae09eb90bf271d95654943bd8c7f783e8a4 (diff)
Article.openInNewWindow: do not crash if window is null
Diffstat (limited to 'js/Article.js')
-rw-r--r--js/Article.js9
1 files 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");