Bug 581542 - EcoreUIUtil.openEditor() throws NPE if viewer is not found for the editor
Summary: EcoreUIUtil.openEditor() throws NPE if viewer is not found for the editor
Status: NEW
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.13.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.13.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 13:08 EST by Andras Janko CLA
Modified: 2024-05-07 01:00 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Janko CLA 2023-02-16 13:08:29 EST
EcoreUIUtil.openEditor(IWorkbenchPage page, Object object, int openStrategy) tries to set the selection in the opened editor to the object. However, it does not handle when the viewer for the previously opened editor is not found, as a result an NPE is thrown.

I recommend to not throw an NPE when the viewer is not found. Similarly when the editor is not found, or when the editor does not implement the IViewerProvider.
Comment 1 Balazs Grill CLA 2024-05-07 01:00:39 EDT
This issue will be migrated to gitlab.