[PR #976] [MERGED] Fix app crash when clicking spaces after slide page items in presentation demo. #1091

Closed
opened 2026-03-04 01:09:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/976
Author: @Zhwt
Created: 4/29/2024
Status: Merged
Merged: 5/24/2024
Merged by: @rivo

Base: masterHead: patch-1


📝 Commits (1)

  • ab1a0c7 Fix panic when clicking spaces after slide page items.

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 demos/presentation/main.go (+4 -0)

📄 Description

The SetHighlightedFunc function is missing boundary check, so when clicking outside of available item list, it will panic with out of bound error.

github.com/rivo/tview@c766eefb38/demos/presentation/main.go (L57-L59)

Fixed by checking slice length first.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/976 **Author:** [@Zhwt](https://github.com/Zhwt) **Created:** 4/29/2024 **Status:** ✅ Merged **Merged:** 5/24/2024 **Merged by:** [@rivo](https://github.com/rivo) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`ab1a0c7`](https://github.com/rivo/tview/commit/ab1a0c7324b0f6cb0503b27bbd0af8247bbdd8b7) Fix panic when clicking spaces after slide page items. ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `demos/presentation/main.go` (+4 -0) </details> ### 📄 Description The `SetHighlightedFunc` function is missing boundary check, so when clicking outside of available item list, it will panic with out of bound error. https://github.com/rivo/tview/blob/c766eefb3803dc4d478ee18f4c9176918e1c09ac/demos/presentation/main.go#L57-L59 Fixed by checking slice length first. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:09:23 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#1091
No description provided.