From 53f835b3cec0cd59df5199609bd03e012f66d6b5 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 2 Dec 2022 20:53:10 -0600 Subject: [PATCH] Guard against negative numbers. Fixes #3768 --- iOS/SceneCoordinator.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 2b63e3199..b26cdc5da 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -657,7 +657,10 @@ class SceneCoordinator: NSObject, UndoableCommandRunner { } func nodeFor(_ indexPath: IndexPath) -> Node? { - guard indexPath.section < shadowTable.count && indexPath.row < shadowTable[indexPath.section].feedNodes.count else { + guard indexPath.section > -1 && + indexPath.row > -1 && + indexPath.section < shadowTable.count && + indexPath.row < shadowTable[indexPath.section].feedNodes.count else { return nil } return shadowTable[indexPath.section].feedNodes[indexPath.row].node