Skip to content

Commit 2f80c65

Browse files
committed
Merge pull request oblador#166 from pkaminski/null-element
Guard against race condition when removing spies
2 parents 561265d + 9b71020 commit 2f80c65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/spy-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ angular.module('duScroll.spyAPI', ['duScroll.scrollContainerAPI'])
2828
for(i = 0; i < spies.length; i++) {
2929
spy = spies[i];
3030
pos = spy.getTargetPosition();
31-
if (!pos) continue;
31+
if (!pos || !spy.$element) continue;
3232

3333
if((duScrollBottomSpy && bottomReached) || (pos.top + spy.offset - containerOffset < 20 && (duScrollGreedy || pos.top*-1 + containerOffset) < pos.height)) {
3434
//Find the one closest the viewport top or the page bottom if it's reached

0 commit comments

Comments
 (0)