Activity.get_preview fails for no window in canvas

When an activity deletes the window associated with the canvas, save may
fail because Gdk.cairo_create is given an argument of None.  Activity
continues to run without a window.

Reproduced with Chat activity and pressing Stop.

Avoid exception by returning None from get_preview when there is no
window.
This commit is contained in:
James Cameron 2018-01-02 14:15:15 +11:00
parent e13c4fefab
commit a77ae5fb57

View File

@ -852,6 +852,9 @@ class Activity(Window, Gtk.Container):
return None
window = self.canvas.get_window()
if window is None:
return None
alloc = self.canvas.get_allocation()
dummy_cr = Gdk.cairo_create(window)