[TIMOB-2160] Android: Image scaling tests run time errors
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M02 |
Components | Android |
Labels | android, android_refactor, defect, image, regression, scaling |
Reporter | Thomas Huelbert |
Assignee | Don Thorp |
Created | 2011-04-15T03:12:21.000+0000 |
Updated | 2011-04-17T01:58:16.000+0000 |
Description
1.BaseUI>Views>Image Scaling
results: errrors followed by image loading.
E/KrollCallback(14575): (kroll$17) [86,1006870] ECMA Error
evaluating source, invocation: [callMethod Titanium.(anonymous)
org.appcelerator.titanium.kroll.KrollCallback@44fe6f48], message:
TypeError: Cannot read property "width" from null
(app://examples/image_view_scaling.js#33)
E/KrollCallback(14575): org.mozilla.javascript.EcmaError:
TypeError: Cannot read property "width" from null
(app://examples/image_view_scaling.js#33)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3786)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3799)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1487)
E/KrollCallback(14575): at
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1408)
E/KrollCallback(14575): at
script(app://examples/image_view_scaling.js:33)
E/KrollCallback(14575): at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollCallback(14575): at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollCallback(14575): at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollCallback(14575): at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
E/KrollCallback(14575): at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
E/KrollCallback(14575): at
org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:97)
E/KrollCallback(14575): at
android.os.Handler.handleCallback(Handler.java:587)
E/KrollCallback(14575): at
android.os.Handler.dispatchMessage(Handler.java:92)
E/KrollCallback(14575): at
android.os.Looper.loop(Looper.java:123)
E/KrollCallback(14575): at
org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)
1.5.0.70ce98 g2 running 2.2, G1 running 1.6, sim 2.2.
persists in todays pull - 1.5.0.91838a, don't think its user error? droid 1 (2.2)
Weird, the error doesn't happen on an emulator for me, nor on my HTC Desire 2.2 device. But then on a whim I turned off the network on my device and indeed the error occurs.
This is a remote image that's being scaled. The KS test is checking
imageView.toBlob().width
without checking iftoBlob()
returns null, so in that case the runtime error isn't surprising. I'm going to change the test slightly to account for this gracefully and put up the message that image wasn't retrieved.Meanwhile, Thomas, are you getting the error also when you're network connection is active? Put another way: are you able to run the remote image test successfully but then not the image scaling test in the same session? (That would be odd.)
(from [c0aff27b322129e48f2092c569efff33a9b0a4a3]) [#2160] Check for blob being null before trying to read its dimensions. https://github.com/appcelerator/titanium_mobile/commit/c0aff27b322129e48f2092c569efff33a9b0a4a3"> https://github.com/appcelerator/titanium_mobile/commit/c0aff27b3221...
Titanium SDK version: 1.5.0 (12/04/10 08:46 b7b9e78) G2 (2.2) sim 2.1