messageList: Don't include message actor in error message

Because the message actor could also be undefined or a already
deallocated ClutterActor, we sometimes fail to show the error message
and get an error from Gjs instead.

So make sure we always log the proper error message and just leave out
the actor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/833
This commit is contained in:
Jonas Dreßler 2019-11-17 14:35:42 +01:00 committed by Florian Müllner
parent 135d178d08
commit 55362aed3d

View File

@ -642,7 +642,7 @@ var MessageListSection = GObject.registerClass({
moveMessage(message, index, animate) { moveMessage(message, index, animate) {
if (!this._messages.includes(message)) if (!this._messages.includes(message))
throw new Error(`Impossible to move the untracked message ${message}`); throw new Error(`Impossible to move untracked message`);
let listItem = message.get_parent(); let listItem = message.get_parent();
@ -671,7 +671,7 @@ var MessageListSection = GObject.registerClass({
removeMessage(message, animate) { removeMessage(message, animate) {
if (!this._messages.includes(message)) if (!this._messages.includes(message))
throw new Error(`Impossible to remove the untracked message ${message}`); throw new Error(`Impossible to remove untracked message`);
let listItem = message.get_parent(); let listItem = message.get_parent();
listItem._connectionsIds.forEach(id => message.disconnect(id)); listItem._connectionsIds.forEach(id => message.disconnect(id));