mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-26244 - NPE: ContentEntryEditor.getContentEntry
This commit is contained in:
+6
-3
@@ -93,9 +93,12 @@ public abstract class ContentEntryEditor implements ContentRootPanel.ActionCallb
|
||||
|
||||
@Nullable
|
||||
protected ContentEntry getContentEntry() {
|
||||
final ContentEntry[] entries = getModel().getContentEntries();
|
||||
for (ContentEntry entry : entries) {
|
||||
if (entry.getUrl().equals(myContentEntryUrl)) return entry;
|
||||
final ModifiableRootModel model = getModel();
|
||||
if (model != null) {
|
||||
final ContentEntry[] entries = model.getContentEntries();
|
||||
for (ContentEntry entry : entries) {
|
||||
if (entry.getUrl().equals(myContentEntryUrl)) return entry;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user