Skip to content

Commit

Permalink
Handle case where IOS can send active child -1
Browse files Browse the repository at this point in the history
Summary:
Sometimes iOS can return active child -1,  which is causing some crashes on desktop, (see the tasks) this is a client bug but the desktop shouldnt crash none the less

seems to occur only sometimes only on fboios

Reviewed By: lblasa

Differential Revision: D46894387

fbshipit-source-id: f9c34fe8fb32691486455224f82bed9c3dce6cef
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Jun 21, 2023
1 parent 9a01411 commit 5e5b56b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ function Visualization2DNode({

//if there is an active child don't draw the other children
//this means we don't draw overlapping activities / tabs etc
if (node.activeChildIdx && node.activeChildIdx < node.children.length) {
if (
node.activeChildIdx != null &&
node.activeChildIdx >= 0 &&
node.activeChildIdx < node.children.length
) {
nestedChildren = [node.children[node.activeChildIdx]];
} else {
nestedChildren = node.children;
Expand Down

0 comments on commit 5e5b56b

Please sign in to comment.