Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 5cf32d0

Browse files
fix(sticky): NPE in
fixes #7316.
1 parent 38f6651 commit 5cf32d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/sticky/sticky.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil, $compile) {
191191
while (current && current !== contentEl[0]) {
192192
item.top += current.offsetTop;
193193
item.left += current.offsetLeft;
194-
item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight
194+
if ( current.offsetParent ){
195+
item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight
196+
}
195197
current = current.offsetParent;
196198
}
197199
item.height = item.element.prop('offsetHeight');

0 commit comments

Comments
 (0)