Skip to content

Commit

Permalink
closeDialog: Fix exception when the window has no app
Browse files Browse the repository at this point in the history
  • Loading branch information
clefebvre committed Jan 7, 2025
1 parent 3773ac1 commit 2aa91fc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/ui/closeDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,18 @@ var CloseDialog = GObject.registerClass({
}

_createDialogContent() {
let name;
let tracker = Cinnamon.WindowTracker.get_default();
let windowApp = tracker.get_window_app(this._window);
if (windowApp) {
name = windowApp.get_name();
}
else {
name = this._window.get_title();
}

/* Translators: %s is an application name */
let title = _('%s is not responding').format(windowApp.get_name());
let title = _('%s is not responding').format(name);
let description = _('You may choose to wait a short while for it to ' +
'continue or force the app to quit entirely.');
return new Dialog.MessageDialogContent({title, description});
Expand Down

0 comments on commit 2aa91fc

Please sign in to comment.