Skip to content

Conversation

Ekopalypse
Copy link
Contributor

@Ekopalypse Ekopalypse commented Aug 21, 2023

This solves the issue that if the menu has been disabled by a user, getMenu returns a NULL pointer and then GetMenuItemCount, returns -1, which is cast to an unsigned int, which then means that it takes a very long time to iterate over non-existent menu items.

Fixes #305

@Ekopalypse
Copy link
Contributor Author

I don't know what I was thinking, but you're right, of course. I can make the changes today after work.

The change was made to match the type of the for loop variable to the value returned by GetMenuItemCount.
@chcg chcg merged commit 75c639d into bruderstein:master Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Script hangs when using notepad.runMenuCommand with non-existent menu items
2 participants