Skip to content

Commit

Permalink
Hard crash
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Apr 5, 2019
1 parent 96a7adf commit 2a5b8a9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/devtools/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,12 @@ export default class Store extends EventEmitter {

i = i + 3;

if (__DEBUG__) {
if (this._idToElement.has(id)) {
console.error(
'Store already contains fiber ' + id + '. This is a bug.'
);
}
if (this._idToElement.has(id)) {
throw new Error(
'Store already contains fiber ' +
id +
'. This is a bug in React DevTools.'
);
}

if (type === ElementTypeRoot) {
Expand Down Expand Up @@ -575,12 +575,12 @@ export default class Store extends EventEmitter {
case TREE_OPERATION_REMOVE:
id = ((operations[i + 1]: any): number);

if (__DEBUG__) {
if (!this._idToElement.has(id)) {
console.error(
'Store does not contain fiber ' + id + '. This is a bug.'
);
}
if (!this._idToElement.has(id)) {
throw new Error(
'Store does not contain fiber ' +
id +
'. This is a bug in React DevTools.'
);
}

i = i + 2;
Expand Down

0 comments on commit 2a5b8a9

Please sign in to comment.