From 7c534a87cfe8aeee220d068115a51c5281f3f5af Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Mon, 28 Feb 2011 22:34:19 +0100 Subject: [PATCH] dnd: Don't pass null to ClutterActor.disconnect() _ungrabActor disconnects the event signal handler but does not check whether it is connected before doing so which can result into an exception like: JS ERROR: !!! Exception was: Error: disconnect() takes one arg, the signal handler id JS ERROR: !!! lineNumber = '0' JS ERROR: !!! fileName = 'gjs_throw' JS ERROR: !!! stack = 'Error("disconnect() takes one arg, the signal handler id")@:0 --- js/ui/dnd.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 021cb2eb3..61776da91 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -144,6 +144,8 @@ _Draggable.prototype = { _ungrabActor: function() { Clutter.ungrab_pointer(); + if (!this._onEventId) + return; this.actor.disconnect(this._onEventId); this._onEventId = null; },