diff --git a/CHANGELOG.md b/CHANGELOG.md index a5a587eb..0eda99c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - A rare bug that causes the app to crash when displaying video cells +- A rare bug where a long press can cause a crash ### Removed diff --git a/playlet-lib/src/components/VideoFeed/VideoRowList.bs b/playlet-lib/src/components/VideoFeed/VideoRowList.bs index 69e77e00..2170afc7 100644 --- a/playlet-lib/src/components/VideoFeed/VideoRowList.bs +++ b/playlet-lib/src/components/VideoFeed/VideoRowList.bs @@ -123,16 +123,21 @@ function OnRowItemLongPressed(index as object) as void return end if + if not IsArray(index) or index.count() <> 2 + LogWarn("Invalid index:", index) + return + end if + rowIndex = index[0] rowItemIndex = index[1] - if rowIndex < 0 or rowIndex >= content.GetChildCount() + if not IsInt(rowIndex) or rowIndex < 0 or rowIndex >= content.GetChildCount() LogWarn("Invalid row index:", rowIndex) return end if row = content.GetChild(rowIndex) - if rowItemIndex < 0 or rowItemIndex >= row.GetChildCount() + if not IsInt(rowItemIndex) or rowItemIndex < 0 or rowItemIndex >= row.GetChildCount() LogWarn("Invalid row item index:", rowItemIndex) return end if