| Summary: | Throwing VetoException("abc") when starting SwingApplication leads to NullPointerException | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Michael Schaufelberger <bsi.msa> | ||||
| Component: | Scout | Assignee: | Stephan Merkli <stephan.merkli> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | Andreas.Hoegger, stephan.merkli | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
obsolete since swing got legacy. |
Created attachment 206334 [details] Patch that removes the unnecessary (and "fatal") statement on line 189 of ErrorHandler. If you throw a VetoException without a title during start up of an AbstractSwingApplication (e.g. to deny access to a user which tries to log in) the application will crash with a NullPointerException. The NullPointerException occurs because in AbstractSwingApplication:200 (showLoadError) handler.getText() is null. The reason why the text is null is because in ErrorHandler:189 it is set to null if the VetoException has no title. Actually at this point the text (m_text) is already set to ScoutTexts.get("Error") (see lines 99 to 102 at the beginning of the parse method) and will now become null. Attached is a patch that removes the unnecessary (and "fatal") statement on line 189 of ErrorHandler. It may also be reasonable to handle the "null" case in AbstractSwingApplication:200 - this is left up to you.