Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-14890

Android: Ti.UI.PickerColumn exception when calling removeRow and useSpinner is true

    Details

      Description

      Problem description

      When removing columns from a picker, if useSpinner is set to true, the application crashes

      Code to reproduce

      Just click the remove button in the app:

      var win = Ti.UI.createWindow({
        layout: 'vertical'
      });
       
      var picker = Ti.UI.createPicker({
        useSpinner: true
      });
       
      var fruit = [ 'Bananas', 'Strawberries', 'Mangos', 'Grapes' ];
      var column1 = Ti.UI.createPickerColumn();
       
      for(var i=0, ilen=fruit.length; i<ilen; i++){
        var row = Ti.UI.createPickerRow({title: fruit[i]});
        column1.addRow(row);
      }
       
      picker.add([column1]);
      win.add(picker);
      win.open();
       
      var btn = Ti.UI.createButton({
      	title: "Remove columns"
      });
      btn.addEventListener('click', function() {
      	var _col = picker.columns[0];
          var len = _col.rowCount;
          for(var x = len-1; x >= 0; x-- ){
              var _row = _col.rows[x];
              _col.removeRow(_row);
          }
      });
      win.add(btn);
      

      Error log

      E/TiApplication(21214): java.lang.NullPointerException: storage == null
      E/TiApplication(21214): 	at java.util.Arrays$ArrayList.<init>(Arrays.java:38)
      E/TiApplication(21214): 	at java.util.Arrays.asList(Arrays.java:154)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.widget.picker.TextWheelAdapter.<init>(TextWheelAdapter.java:28)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinnerColumn.refreshNativeView(TiUISpinnerColumn.java:180)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinner.refreshColumn(TiUISpinner.java:63)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinner.refreshColumn(TiUISpinner.java:56)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinner.onColumnModelChanged(TiUISpinner.java:99)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.PickerProxy.handleFireColumnModelChange(PickerProxy.java:706)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.PickerProxy.fireColumnModelChange(PickerProxy.java:694)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.PickerProxy.rowRemoved(PickerProxy.java:765)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.PickerColumnProxy.handleRemoveRow(PickerColumnProxy.java:160)
      E/TiApplication(21214): 	at ti.modules.titanium.ui.PickerColumnProxy.handleMessage(PickerColumnProxy.java:76)
      E/TiApplication(21214): 	at android.os.Handler.dispatchMessage(Handler.java:95)
      E/TiApplication(21214): 	at android.os.Looper.loop(Looper.java:137)
      E/TiApplication(21214): 	at android.app.ActivityThread.main(ActivityThread.java:5103)
      E/TiApplication(21214): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/TiApplication(21214): 	at java.lang.reflect.Method.invoke(Method.java:525)
      E/TiApplication(21214): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      E/TiApplication(21214): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      E/TiApplication(21214): 	at dalvik.system.NativeStart.main(Native Method)
      E/AndroidRuntime(21214): FATAL EXCEPTION: main
      E/AndroidRuntime(21214): java.lang.NullPointerException: storage == null
      E/AndroidRuntime(21214): 	at java.util.Arrays$ArrayList.<init>(Arrays.java:38)
      E/AndroidRuntime(21214): 	at java.util.Arrays.asList(Arrays.java:154)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.widget.picker.TextWheelAdapter.<init>(TextWheelAdapter.java:28)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinnerColumn.refreshNativeView(TiUISpinnerColumn.java:180)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinner.refreshColumn(TiUISpinner.java:63)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinner.refreshColumn(TiUISpinner.java:56)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.widget.picker.TiUISpinner.onColumnModelChanged(TiUISpinner.java:99)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.PickerProxy.handleFireColumnModelChange(PickerProxy.java:706)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.PickerProxy.fireColumnModelChange(PickerProxy.java:694)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.PickerProxy.rowRemoved(PickerProxy.java:765)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.PickerColumnProxy.handleRemoveRow(PickerColumnProxy.java:160)
      E/AndroidRuntime(21214): 	at ti.modules.titanium.ui.PickerColumnProxy.handleMessage(PickerColumnProxy.java:76)
      E/AndroidRuntime(21214): 	at android.os.Handler.dispatchMessage(Handler.java:95)
      E/AndroidRuntime(21214): 	at android.os.Looper.loop(Looper.java:137)
      E/AndroidRuntime(21214): 	at android.app.ActivityThread.main(ActivityThread.java:5103)
      E/AndroidRuntime(21214): 	at java.lang.reflect.Method.invokeNative(Native Method)
      E/AndroidRuntime(21214): 	at java.lang.reflect.Method.invoke(Method.java:525)
      E/AndroidRuntime(21214): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
      E/AndroidRuntime(21214): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
      E/AndroidRuntime(21214): 	at dalvik.system.NativeStart.main(Native Method)
      

        Attachments

          Activity

            People

            • Assignee:
              bijuexalture Biju pm
              Reporter:
              dcassenti Davide Cassenti
              Reviewer:
              Vishal Duggal (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-17217
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration