mirror of
https://github.com/urbit/shrub.git
synced 2024-12-11 11:02:25 +03:00
VirtualScroller: do not crash if ref is unset
This commit is contained in:
parent
2705f157c0
commit
dbf8c2afb9
@ -504,6 +504,11 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
|
||||
|
||||
this.savedIndex = bottomIndex;
|
||||
const ref = this.childRefs.get(bottomIndex.toString())!;
|
||||
if(!ref) {
|
||||
this.saveDepth--;
|
||||
log('bail', 'missing ref');
|
||||
return;
|
||||
}
|
||||
const { offsetTop } = ref;
|
||||
this.savedDistance = topSpacing - offsetTop
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user