Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3522] Android java.lang.NullPointerException when making HTTP call with invalid Url

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-07T22:53:28.000+0000
Affected Version/sRelease 1.6.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterDaniel Cameron
AssigneeIngo Muschenetz
Created2011-04-15T03:46:15.000+0000
Updated2017-06-07T22:53:28.000+0000

Description

Titanium Mobile 1.6.1
Android SDK r10

Passing an invalid URL to to a xhr invocation causes a null pointer exception instead of a meaningful error message about a malformed URL.

var xhr = Titanium.Network.createHTTPClient();
xhr.open('GET', "null/query");
[TRACE] E/KrollMethod( 622): (kroll$1: app://app.js) [5,13127] Exception calling kroll method open, invocation: null ]
[TRACE] E/KrollMethod( 622): java.lang.NullPointerException
[TRACE] E/KrollMethod( 622): at ti.modules.titanium.network.TiHTTPClient.getCleanUri(TiHTTPClient.java:702)
[TRACE] E/KrollMethod( 622): at ti.modules.titanium.network.TiHTTPClient.open(TiHTTPClient.java:726)
[TRACE] E/KrollMethod( 622): at ti.modules.titanium.network.HTTPClientProxy.open(HTTPClientProxy.java:81)
[TRACE] E/KrollMethod( 622): at ti.modules.titanium.network.HTTPClientProxyBindingGen$23.invoke(HTTPClientProxyBindingGen.java:756)
[TRACE] E/KrollMethod( 622): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1711)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
[TRACE] E/KrollMethod( 622): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
[TRACE] E/KrollMethod( 622): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:211)
[TRACE] E/KrollMethod( 622): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:236)
[TRACE] E/KrollMethod( 622): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:122)
[TRACE] E/KrollMethod( 622): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
[TRACE] E/KrollMethod( 622): at android.os.Handler.dispatchMessage(Handler.java:95)
[TRACE] E/KrollMethod( 622): at android.os.Looper.loop(Looper.java:123)
[TRACE] E/KrollMethod( 622): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:89)
[TRACE] E/KrollContext( 622): (kroll$1: app://app.js) [54,13181] Error evaluating source: Wrapped java.lang.NullPointerException

Comments

  1. Lee Morris 2017-06-07

    Closing ticket due to time passed.

JSON Source