Skip to content

Commit

Permalink
Fixed bug in MenuButton
Browse files Browse the repository at this point in the history
- Closes #3202
  • Loading branch information
latenitefilms committed Jun 15, 2023
1 parent 30c2e7a commit 5d18558
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/extensions/cp/ui/MenuButton.lua
Expand Up @@ -196,7 +196,12 @@ function MenuButton:selectItemMatching(pattern)
local ui = self:UI()
if ui then
local title = ui:attributeValue("AXTitle")
if string.match(title, pattern) then
--------------------------------------------------------------------------------
-- NOTE: For some reason on macOS Ventura this title can sometimes be nil.
-- This problem doesn't happen on macOS Monterey. Hence we check that
-- `title` is valid below:
--------------------------------------------------------------------------------
if title and string.match(title, pattern) then
-- Don't bother selecting if it's already selected.
return true
end
Expand Down

0 comments on commit 5d18558

Please sign in to comment.