X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java index a0a6023..a5171dc 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/views/browser/BrowserView.java @@ -27,7 +27,14 @@ public class BrowserView extends ViewPart { * @see ViewPart#createPartControl */ public void createPartControl(Composite frame) { - instance = new PHPBrowser(frame); + try { + instance = new PHPBrowser(frame); + if (instance.browser==null) { + instance = null; + } + } catch(Exception e) { + instance = null; + } } /** * Called when we must grab focus. @@ -35,17 +42,28 @@ public class BrowserView extends ViewPart { * @see org.eclipse.ui.part.ViewPart#setFocus */ public void setFocus() { - instance.setFocus(); + if (instance!=null) { + instance.setFocus(); + } } /** * Called when the View is to be disposed */ public void dispose() { - instance.dispose(); - instance = null; + if (instance!=null) { + instance.dispose(); + instance = null; + } super.dispose(); } public void setUrl(String url) { - instance.browser.setUrl(url); + if (instance!=null) { + instance.browser.setUrl(url); + } + } + public void refresh() { + if (instance!=null) { + instance.browser.refresh(); + } } }