Project: SWT
Bug 101093 [browser] crash when setting html as url
Reported: 2005-06-21 13:31:26 | Status: resolved fixed

3.1RC3 - run the snippet below and click on the shell - this does a setUrl() with some html contents (I meant to do setText()) - this causes a crash because the third line of decidePolicyForNavigationAction tries to CFStringGetLength on 0 public static void main (String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setBounds(10,10,300,300); final Browser browser = new Browser(shell, SWT.NONE); browser.setBounds(10,10,250,250); shell.open(); shell.addListener(SWT.MouseDown, new Listener() { public void handleEvent(Event event) { String string = "<html><body></body></html>"; browser.setUrl(string); } }); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Browser/carbon/org/eclipse/swt/browser/Browser.java