I have building a win32 JCEF project and tring to test the 'tests.detailed.MainFrame.java' in eclipse.
There was a problems occurred.
when I click the abort before the current website has been loaded,an exception will be occurred.
In function onLoadError,the "errorCode" is null,and the "errorText" gets the value of errorCode,
the "failedUrl" gets the value of "errorText".
- Code: Select all
public void onLoadError(CefBrowser browser, int frameIdentifer,
ErrorCode errorCode,
String errorText, String failedUrl)
{
if (errorCode != ErrorCode.ERR_NONE && errorCode != ErrorCode.ERR_ABORTED)
{
errorMsg_ = "<html><head>";
errorMsg_ += "<title>Error while loading</title>";
errorMsg_ += "</head><body>";
errorMsg_ += "<h1>" + errorCode + "</h1>";
errorMsg_ += "<h3>Failed to load " + failedUrl + "</h3>";
String string = (errorText == null ? "" : errorText);
errorMsg_ += "<p>" + string + "</p>";
errorMsg_ += "</body></html>";
browser.stopLoad();
}
}
The console is:
- Code: Select all
java.lang.NullPointerException
at java.lang.String.length(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuilder.append(Unknown Source)
at tests.detailed.MainFrame32Detailed$3.onLoadError(MainFrame32Detailed.java:193)
at org.cef.CefClient.onLoadError(CefClient.java:638)
It didn't occurred in win64 project.How to deal with it?
Thanks in advance,
Leif