From 6850401f9c45d4f36c187bfc4065784dd065e8e9 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 26 Nov 2012 23:59:29 +0200 Subject: [PATCH] Ensure critical notifications have an owner (#10386) Change-Id: Id954f1fbc98625dac4c79637ffb2f03bde195c3d --- client/src/com/vaadin/client/VDebugConsole.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/com/vaadin/client/VDebugConsole.java b/client/src/com/vaadin/client/VDebugConsole.java index 67980cc5a3..a6eb769059 100644 --- a/client/src/com/vaadin/client/VDebugConsole.java +++ b/client/src/com/vaadin/client/VDebugConsole.java @@ -694,7 +694,18 @@ public class VDebugConsole extends VOverlay implements Console { e.printStackTrace(); } try { - VNotification.createNotification(VNotification.DELAY_FOREVER, null) + Widget owner = null; + + if (!ApplicationConfiguration.getRunningApplications().isEmpty()) { + // Make a wild guess and use the first available + // ApplicationConnection. This is better than than leaving the + // exception completely unstyled... + ApplicationConnection connection = ApplicationConfiguration + .getRunningApplications().get(0); + owner = connection.getUIConnector().getWidget(); + } + VNotification + .createNotification(VNotification.DELAY_FOREVER, owner) .show("

Uncaught client side exception


" + exceptionText, VNotification.CENTERED, "error"); } catch (Exception e2) { -- 2.39.5