Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23785] Windows: Error thrown when updating list section item that doesn't exist

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2016-08-31T09:11:51.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.1.0
ComponentsWindows
Labelsparity, qe-6.0.0
ReporterEwan Harris
AssigneeGary Mathews
Created2016-08-17T15:47:00.000+0000
Updated2016-12-03T00:23:05.000+0000

Description

Description

When using the code below an error is thrown, to be in parity with other platforms an error should not be thrown and a warning should be logged, for example iOS logs \[WARN\] ListView: Update item index is out of range
var win = Ti.UI.createWindow({ backgroundColor: 'blue' }),
    section = Ti.UI.createListSection({
        items: [
            { properties: { title: 'B' } },
            { properties: { title: 'A' } },
            { properties: { title: 'E' } },
            { properties: { title: 'G' } }
        ]
    }),
    listView = Ti.UI.createListView({ sections: [section] });
section.updateItemAt(4, { properties: { title: 'B' } });

win.add(listView);
win.open();

Steps to reproduce

Add the above code to an existing app.js

Build for windows platform

Actual results

An error is thrown

Expected results

To maintain parity an error should not be thrown, a warning should be logged

Comments

  1. Gary Mathews 2016-08-27

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/841
  2. Samir Mohammed 2016-12-03

    Verified fixed, console now logs the following warning: [WARN] : ListSection::updateItemAt() index is out of range *Environment*
       Device: Lumia 640 LTE
       Operating System
         Name                        = Microsoft Windows 10 Pro
         Version                     = 10.0.14393
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 17034395648
        
       Node.js
         Node.js Version             = 4.4.4
         npm Version                 = 2.11.3
        
       Titanium CLI
         CLI Version                 = 5.0.10
        
       Titanium SDK
         SDK Version                 = 6.1.0.v20161202124434
         Target Platform             = windows
       

JSON Source