mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +02:00
null pointer check for active window
This commit is contained in:
parent
d16a66b514
commit
04697ae05c
1 changed files with 12 additions and 1 deletions
|
@ -964,7 +964,18 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
|
|||
if (activePage == null)
|
||||
{
|
||||
IWorkbenchWindow activeWindow = wb.getActiveWorkbenchWindow();
|
||||
activePage = activeWindow.getActivePage();
|
||||
if (activeWindow == null)
|
||||
{
|
||||
activePage = activeWindow.getActivePage();
|
||||
}
|
||||
else
|
||||
{
|
||||
IWorkbenchWindow[] windows = wb.getWorkbenchWindows();
|
||||
if (windows != null && windows.length > 0)
|
||||
{
|
||||
activePage = windows[0].getActivePage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IEditorReference[] activeReferences = activePage.getEditorReferences();
|
||||
|
|
Loading…
Add table
Reference in a new issue