forked from github/cordova-android
Fix exception when plugin returns a null string.
This commit is contained in:
parent
7d3afcab94
commit
cba0d59021
@ -398,7 +398,12 @@ public class NativeToJsMessageQueue {
|
|||||||
ret += 1 + pluginResult.getMessage().length();
|
ret += 1 + pluginResult.getMessage().length();
|
||||||
break;
|
break;
|
||||||
case PluginResult.MESSAGE_TYPE_STRING: // s
|
case PluginResult.MESSAGE_TYPE_STRING: // s
|
||||||
|
if (pluginResult.getStrMessage() == null) {
|
||||||
|
ret += 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
ret += 1 + pluginResult.getStrMessage().length();
|
ret += 1 + pluginResult.getStrMessage().length();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PluginResult.MESSAGE_TYPE_JSON:
|
case PluginResult.MESSAGE_TYPE_JSON:
|
||||||
default:
|
default:
|
||||||
@ -433,8 +438,10 @@ public class NativeToJsMessageQueue {
|
|||||||
.append(pluginResult.getMessage());
|
.append(pluginResult.getMessage());
|
||||||
break;
|
break;
|
||||||
case PluginResult.MESSAGE_TYPE_STRING: // s
|
case PluginResult.MESSAGE_TYPE_STRING: // s
|
||||||
sb.append('s')
|
sb.append('s');
|
||||||
.append(pluginResult.getStrMessage());
|
if (pluginResult.getStrMessage() != null) {
|
||||||
|
sb.append(pluginResult.getStrMessage());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PluginResult.MESSAGE_TYPE_JSON:
|
case PluginResult.MESSAGE_TYPE_JSON:
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user