From 5880758709614fcbdf425bc8e97ff45aa5b74b4a Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 27 Nov 2018 12:10:45 -0200 Subject: [PATCH] dnd: Don't try to destroy undefined drag actor Draggable._dragComplete() sets this._dragActor to undefined. Right after calling Draggable._dragComplete() in _cancelDrag(), though, it tries to destroy this._dragActor, which is undefined. Fix that by storing the current drag actor before calling into _dragComplete(), and using it after. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/744 --- js/ui/dnd.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 786d65419..e27c3691f 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -642,12 +642,13 @@ var _Draggable = class _Draggable { this._dragState = DragState.CANCELLED; if (this._actorDestroyed || wasCancelled) { + let dragActor = this._dragActor; global.display.set_cursor(Meta.Cursor.DEFAULT); if (!this._buttonDown) this._dragComplete(); this.emit('drag-end', eventTime, false); - if (!this._dragOrigParent && this._dragActor) - this._dragActor.destroy(); + if (!this._dragOrigParent && dragActor) + dragActor.destroy(); return; }