Article.openInNewWindow: do not crash if window is null

This commit is contained in:
Andrew Dolgov 2018-12-09 04:32:41 +03:00
parent 8f5b5ae09e
commit c8253f0e64
1 changed files with 6 additions and 3 deletions

View File

@ -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");