From 78c9612257b95ee924ad0b13372106bde3d851f8 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Jun 10 2014 13:45:18 +0000 Subject: Remove warning when removing display Some display have no associated window (for ex, if it doesn't fit on client monitors). (remote-viewer:22275): remote-viewer-CRITICAL **: virt_viewer_window_set_display: assertion `VIRT_VIEWER_IS_WINDOW(self)' failed (remote-viewer:22275): remote-viewer-CRITICAL **: virt_viewer_app_remove_nth_window: assertion `win != NULL' failed https://bugzilla.redhat.com/show_bug.cgi?id=1107518 --- diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c index 92ecc64..1633c25 100644 --- a/src/virt-viewer-app.c +++ b/src/virt-viewer-app.c @@ -870,8 +870,10 @@ virt_viewer_app_display_removed(VirtViewerSession *session G_GNUC_UNUSED, gtk_widget_hide(GTK_WIDGET(display)); g_object_get(display, "nth-display", &nth, NULL); win = virt_viewer_app_get_nth_window(self, nth); - virt_viewer_window_set_display(win, NULL); + if (!win) + return; + virt_viewer_window_set_display(win, NULL); if (nth != 0) virt_viewer_app_remove_nth_window(self, nth); }