ScreenshotManager: Null-check the window in screenshot_window() (#627)

This commit is contained in:
Alexander Mikhaylenko 2019-11-04 22:18:25 +05:00 committed by Daniel Foré
parent 909832a3e5
commit d1d415c9f0

View File

@ -115,6 +115,11 @@ namespace Gala
#else #else
var window = wm.get_screen ().get_display ().get_focus_window (); var window = wm.get_screen ().get_display ().get_focus_window ();
#endif #endif
if (window == null) {
throw new DBusError.FAILED ("Cannot find active window");
}
var window_actor = (Meta.WindowActor) window.get_compositor_private (); var window_actor = (Meta.WindowActor) window.get_compositor_private ();
unowned Meta.ShapedTexture window_texture = (Meta.ShapedTexture) window_actor.get_texture (); unowned Meta.ShapedTexture window_texture = (Meta.ShapedTexture) window_actor.get_texture ();