[TextViewer] bug fix, don't crash on Menu press#14936
Merged
Merged
Conversation
hius07
reviewed
Feb 5, 2026
| end | ||
|
|
||
| function TextViewer:onShowMenu() | ||
| if not self.titlebar.left_icon then return end -- Menu could be triggered with a key event. |
Member
There was a problem hiding this comment.
I propose to use the original trigger:
hius07
reviewed
Feb 5, 2026
| buttons = buttons, | ||
| anchor = function() | ||
| return self.titlebar.left_button.image.dimen | ||
| if self.titlebar.left_button then |
Member
Author
There was a problem hiding this comment.
lol, first i solved this, then realised the menu was being trigerred when it shouldn't. one should do it
hius07
approved these changes
Feb 5, 2026
0xstillb
pushed a commit
to 0xstillb/koreader-thai
that referenced
this pull request
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bug fix
onShowMenu()to ensureself.titlebar.left_iconexists before proceeding, preventing errors if the menu is triggered via a key event and the icon is missing.self.titlebar.left_buttonif it exists, avoiding potential nil reference errors.This change is