// If this view is already visible just return.
IViewReference ref = persp.findView(BrowserView.ID_BROWSER, null);
IViewPart view = null;
- if (ref != null)
+ if (ref != null) {
view = ref.getView(true);
- IShowInTarget target = getShowInTarget(view);
- if (target != null && target.show(context)) {
- // success
}
- ((WorkbenchPage) page).performedShowIn(BrowserView.ID_BROWSER);
+ if (view != null) {
+ IShowInTarget target = getShowInTarget(view);
+ if (target != null && target.show(context)) {
+ // success
+ }
+ ((WorkbenchPage) page).performedShowIn(BrowserView.ID_BROWSER);
+ }
}
// IViewPart view = page.showView(BrowserView.ID_BROWSER);