Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2846] Cannot read property '0' of undefined in events.js

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2012-02-17T17:03:32.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labels1.8.2, 2.0.0, android, events
ReporterJustin Toth
AssigneeMauro Parra-Miranda
Created2012-02-16T08:09:32.000+0000
Updated2016-03-08T07:47:47.000+0000

Description

Ever since upgrading to the latest CI builds in 1.8 and 2.0, I've been running into this error:
E/TiJSError(  800): (main) [7511,46846] ----- Titanium Javascript Runtime Error -----
E/TiJSError(  800): (main) [1,46847] - In ti:/events.js:241,23
E/TiJSError(  800): (main) [0,46847] - Message: Uncaught TypeError: Cannot read property '0' of undefined
E/TiJSError(  800): (main) [1,46848] - Source: 					if (list.listener[i] === listener ||
E/V8Exception(  800): Exception occurred at ti:/events.js:241: Uncaught TypeError: Cannot read property '0' of undefined
It has been difficult to reproduce it since it doesn't happen very often so I can't give reproduction code, but it seems to be related to either closing a window or removing an event listener (probably the latter.) I created a pull request to add a null check around this code, which should prevent the issue. Forgive me if I did it wrong, it was my first pull request to Titanium. [https://github.com/appcelerator/titanium_mobile/pull/1443]

Comments

  1. Justin Toth 2012-02-17

    This can be closed, the issue was with my management of windows, as I wasn't aware that android:back doesn't fire for non-heavyweight windows.
  2. Mauro Parra-Miranda 2012-02-17

    User confirmed that was failing because of the back behavior on light and heavy windows.
  3. Mauro Parra-Miranda 2013-11-24

    Invalid issue.

JSON Source