From 059f1f58f721cdf40d88a90d8f2b992d8c446477 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Tue, 13 Dec 2022 21:51:23 +0100 Subject: [PATCH] application: Don't access unitialized variable in shutdown Guard all usage of this._mainWindow from being used when uninitialized in the shutdown vfunc. This happens e.g. when running with the --version command line flag. --- src/application.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/application.js b/src/application.js index b0099891..d787dea3 100644 --- a/src/application.js +++ b/src/application.js @@ -363,8 +363,9 @@ export class Application extends Adw.Application { // need to unparent popover children to avoid GTK warnings on exit if (this._mainWindow) { this._mainWindow.placeEntry.popover.unparent(); + this._mainWindow.sidebar.unparentSearchPopovers(); } - this._mainWindow.sidebar.unparentSearchPopovers(); + super.vfunc_shutdown(); } } -- GitLab