diff options
-rw-r--r-- | src/MTools/Comp/MMultiSelection.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/MTools/Comp/MMultiSelection.pm b/src/MTools/Comp/MMultiSelection.pm index 8be6ecc..e7c7b67 100644 --- a/src/MTools/Comp/MMultiSelection.pm +++ b/src/MTools/Comp/MMultiSelection.pm @@ -271,13 +271,13 @@ sub addDropTarget { sub removeDropTarget { my ($self, $target) = @_; - if ($self -> {__last_notified} == $target) + if (defined $self -> {__last_notified} && $self -> {__last_notified} == $target) { $self -> {__last_notified} = undef; } for (my $i = @{$self -> {__drop_targets}} - 1; $i >= 0; $i--) { - if (@{$self -> {__drop_targets}} [$i] eq $target) + if (@{$self -> {__drop_targets}} [$i] == $target) { splice (@{$self -> {__drop_targets}}, $i, 1); last; @@ -528,9 +528,9 @@ sub __update_fleche_moved { $self -> {__last_notified} = undef; for (my $i = 0; $i < @targets; $i ++) { - if (minstance ($targets [$i]) == $selected [0] || minstance ($targets [$i]) == $selected [1]) + if (defined $selected [0] && minstance ($targets [$i]) == $selected [0] || defined $selected [1] && minstance ($targets [$i]) == $selected [1]) { - if ($last_notified != $targets [$i]) + if (!defined $last_notified || $last_notified != $targets [$i]) { $targets [$i] -> notify ('DRAGENTER'); } @@ -538,7 +538,7 @@ sub __update_fleche_moved { } else { - if ($last_notified == $targets [$i]) + if (defined $last_notified && $last_notified == $targets [$i]) { $targets [$i] -> notify ('DRAGLEAVE'); } |