From afc7e605ff1aefadd43ab52606f54afb9f58deae Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Sat, 20 Nov 2010 21:23:15 -0600 Subject: [PATCH] Fix bug when not doing cast - temp isn't defined. --- framework/src/com/phonegap/api/PluginResult.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/com/phonegap/api/PluginResult.java b/framework/src/com/phonegap/api/PluginResult.java index 322bcce9..d042d64c 100755 --- a/framework/src/com/phonegap/api/PluginResult.java +++ b/framework/src/com/phonegap/api/PluginResult.java @@ -81,8 +81,11 @@ public class PluginResult { StringBuffer buf = new StringBuffer(""); if (cast != null) { buf.append("var temp = "+cast+"("+this.getJSONString() + ");\n"); + buf.append("PhoneGap.callbackSuccess('"+callbackId+"',temp);"); + } + else { + buf.append("PhoneGap.callbackSuccess('"+callbackId+"',"+this.getJSONString()+");"); } - buf.append("PhoneGap.callbackSuccess('"+callbackId+"', temp );"); return buf.toString(); }