Skip to content

Commit

Permalink
prevent possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
klues committed Apr 8, 2024
1 parent 159eb46 commit cd41c67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/service/stateService.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ function getElement(id) {
if (!_currentGrid || !id) {
return null;
}
let globalGridElements = _currentGlobalGrid ? _currentGlobalGrid.gridElements : [];
return (
_currentGrid.gridElements.filter((e) => e.id === id)[0] ||
_currentGlobalGrid.gridElements.filter((e) => e.id === id)[0]
globalGridElements.filter((e) => e.id === id)[0]
);
}

Expand Down

0 comments on commit cd41c67

Please sign in to comment.