summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBenoit Hiller2013-03-12 20:42:21 (EDT)
committer Grant Gayed2013-03-13 10:00:45 (EDT)
commit9b66864a124cfaa40908a43ae368184c34689b61 (patch)
treea765f890ca90b67db1156ce69741c2f9e79b8d07
parent2fda1a8b1cf8051f0e9df648ede1a836628992b1 (diff)
downloadeclipse.platform.swt-9b66864a124cfaa40908a43ae368184c34689b61.zip
eclipse.platform.swt-9b66864a124cfaa40908a43ae368184c34689b61.tar.gz
eclipse.platform.swt-9b66864a124cfaa40908a43ae368184c34689b61.tar.bz2
adding guard for null strings to extract method
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java
index a274374..bb3035f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT CEF/win32/org/eclipse/swt/browser/CEF.java
@@ -172,12 +172,16 @@ static long /*int*/ CreateCEFString(String string) {
}
static String ExtractCEFString(long /*int*/ stringPointer) {
+ if (stringPointer == 0) {
+ return "";
+ }
+
cef_string_t cefStringUrl = new cef_string_t();
CEF3.memmove(cefStringUrl, stringPointer, CEF3.cef_string_t_sizeof());
int length = (int)/*64*/cefStringUrl.length;
char[] chars = new char[length];
- OS.memmove(chars, cefStringUrl.str, length * 2);
+ OS.memmove(chars, (int)/*64*/cefStringUrl.str, length * 2);
return new String(chars);
}