Skip to content

Fix: Improve null safety and error handling in findElementWithCmdURL#481

Open
Manas-Dikshit wants to merge 1 commit into
LibreOffice:mainfrom
Manas-Dikshit:main
Open

Fix: Improve null safety and error handling in findElementWithCmdURL#481
Manas-Dikshit wants to merge 1 commit into
LibreOffice:mainfrom
Manas-Dikshit:main

Conversation

@Manas-Dikshit

Copy link
Copy Markdown

the findElementWithCmdURL method to prevent hidden crashes and make error diagnosis easier:

Added null checks for menu, cmdUrl, and PropertyValue[] entries.

Replaced string equality with Objects.equals() for null-safe comparisons.

Improved exception handling:

RuntimeExceptions are logged and rethrown (so critical issues aren’t silently swallowed).

Checked exceptions are logged with context at error level.

Logging improvements: meaningful messages for invalid inputs and unexpected conditions.

These changes ensure that potential null pointer errors won’t bring down LibreOffice silently, and any actual root causes are visible in logs instead of being hidden behind a generic trace statement.

@Manas-Dikshit

Manas-Dikshit commented Aug 17, 2025

Copy link
Copy Markdown
Author

help me to get the proper issue after changing the code

@smehrbrodt

Copy link
Copy Markdown
Contributor

Does this fix some actual bug?

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.

2 participants