Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2353] Android: Handle missing properties gapLength and/or dashLength for polyline gracefully

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0, Release 3.3.0
Fix Version/sn/a
ComponentsMap
Labelsn/a
ReporterLokesh Choudhary
AssigneeUnknown
Created2017-08-28T22:44:23.000+0000
Updated2018-03-06T18:52:33.000+0000

Description

Steps to reproduce:

1. Use the following code in the tiapp.xml.
var Map = require('ti.map');
 
var win = Ti.UI.createWindow();
var mapView = Map.createView({
    region: {
        latitude: 37.338208,
        longitude: -121.886329,
        latitudeDelta: 0.1,
        longitudeDelta: 0.1
    }
});
 
mapView.addPolyline(Map.createPolyline({
    strokeColor: 'red',
    points: [{
        latitude: 37.338208,
        longitude: -121.886329
    }, {
        latitude: 37.138208,
        longitude: -121.686329
    }],
    pattern: {
        type: Map.POLYLINE_PATTERN_DASHED, // Also try POLYLINE_PATTERN_DASHED
        gapLength: 20,
        //dashLength: 100
    }
}));
 
win.add(mapView);
win.open();
2. Run on android device.

Actual result:

1. The app crashes with error below:
[ERROR] :  [Pixel] TiApplication: (main) [728,728] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference; Titanium 6.2.0,2017/08/28 14:10,undefined
[ERROR] :  [Pixel] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
[ERROR] :  [Pixel] TiApplication: 	at ti.map.PolylineProxy.processPatternDefinition(PolylineProxy.java:284)
[ERROR] :  [Pixel] TiApplication: 	at ti.map.PolylineProxy.processOptions(PolylineProxy.java:167)
[ERROR] :  [Pixel] TiApplication: 	at ti.map.TiUIMapView.addPolyline(TiUIMapView.java:602)
[ERROR] :  [Pixel] TiApplication: 	at ti.map.TiUIMapView.processPreloadPolylines(TiUIMapView.java:149)
[ERROR] :  [Pixel] TiApplication: 	at ti.map.TiUIMapView.onMapReady(TiUIMapView.java:168)
[ERROR] :  [Pixel] TiApplication: 	at com.google.android.gms.maps.SupportMapFragment$zza$1.zza(Unknown Source)
[ERROR] :  [Pixel] TiApplication: 	at com.google.android.gms.maps.internal.zzt$zza.onTransact(Unknown Source)
[ERROR] :  [Pixel] TiApplication: 	at android.os.Binder.transact(Binder.java:499)
[ERROR] :  [Pixel] TiApplication: 	at gl.b(:com.google.android.gms.DynamiteModulesB:20)
[ERROR] :  [Pixel] TiApplication: 	at com.google.android.gms.maps.internal.bf.a(:com.google.android.gms.DynamiteModulesB:5)
[ERROR] :  [Pixel] TiApplication: 	at com.google.maps.api.android.lib6.impl.bb.run(:com.google.android.gms.DynamiteModulesB:5)
[ERROR] :  [Pixel] TiApplication: 	at android.os.Handler.handleCallback(Handler.java:751)
[ERROR] :  [Pixel] TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] :  [Pixel] TiApplication: 	at android.os.Looper.loop(Looper.java:154)
[ERROR] :  [Pixel] TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
[ERROR] :  [Pixel] TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  [Pixel] TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
[ERROR] :  [Pixel] TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Expected result:

1. The app should not crash but should fail gracefully with an error message.

Comments

No comments

JSON Source