Skip to content

Commit 0983a3a

Browse files
committed
Add fish.length check
1 parent 352b923 commit 0983a3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/demo/ui.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ let Pond = class Pond extends React.Component {
894894
const fish = showRecallFish ? state.recallFish : state.pondFish;
895895

896896
// Don't call arrangeFish if fish have already been arranged.
897-
if (!fish[0].getXY()) {
897+
if (fish.length > 0 && !fish[0].getXY()) {
898898
arrangeFish(fish);
899899
}
900900

0 commit comments

Comments
 (0)