From 391844ec594aaf8904935209a1b82823862c22a6 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Sun, 30 Apr 2017 20:15:32 -0400
Subject: [PATCH] another attempt at guarding against out-of-order messages

---
 pd/nw/pdgui.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index a5c38a5fd..71cca8438 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -1958,10 +1958,12 @@ function gui_message_redraw_border(cid, tag, width, height) {
     var g, b;
     if (patchwin[cid]) {
         g = get_gobj(cid, tag);
-        b = g.querySelector(".border");
-        configure_item(b, {
-            points: message_border_points(width, height),
-        });
+        if (g) {
+            b = g.querySelector(".border");
+            configure_item(b, {
+                points: message_border_points(width, height),
+            });
+        }
     }
 }
 
-- 
GitLab