Skip to content

Commit

Permalink
Popup tests: return false if map.events.listeners.movestart is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
fredj committed Jan 16, 2012
1 parent 8905ef2 commit 0e8b3f2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/Popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,14 @@
//closeOnMove
var checkMapEvent = function(map, popup) {
var startListeners = map.events.listeners['movestart'];
for(var i=0; i < startListeners.length; i++) {
var listener = startListeners[i];

if ((listener.obj == popup) && (listener.func == popup.hide)) {
return true;
if (startListeners) {
for (var i = 0; i < startListeners.length; i++) {
var listener = startListeners[i];
if ((listener.obj == popup) && (listener.func == popup.hide)) {
return true;
}
}
}
}
return false;
};
var registered = checkMapEvent(map1, popup);
Expand Down

0 comments on commit 0e8b3f2

Please sign in to comment.