Adding tearing warning to Store
Brian Vaughn committed
Jan 31, 2019 at 15:59 UTC
ad74c54670de6982978e91bc5cc259ced20ca1a9
1 file changed
+4
-2
src/devtools/store.js
+4
-2
@@ -57,13 +57,15 @@ export default class Store extends EventEmitter {
57
return this._roots;
58
}
59
60
- getElementAtIndex(index: number): Element {
60
+ getElementAtIndex(index: number): Element | null {
61
if (index < 0 || index >= this.numElements) {
62
- throw Error(
62
+ console.warn(
63
`Invalid index ${index} specified; store contains ${
64
this.numElements
65
} items.`
66
);
67
+
68
+ return null;
69
}
70
71
// Find wich root this element is in...