Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1507] Android: Remote images in ImageView/TableView sporadically causes NPE

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-08-20T15:50:38.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, imageview, tableview
ReporterMarshall Culpepper
AssigneeNeeraj Gupta
Created2011-04-15T02:54:40.000+0000
Updated2017-03-22T20:51:19.000+0000

Description

It looks like loadDrawable() in TiBackgroundImageLoadTask (line 58) is returning a BitmapDrawable that has a null Bitmap in some instances, we need to more gracefully handle that situation. See helpdesk #35081.

Comments

  1. Bill Dawson 2011-04-15

    For another customer yesterday I made this change:

    http://github.com/appcelerator/titanium_mobile/commit/91ddf8884ecc961369cb131b635d91c102eb2cc8"> http://github.com/appcelerator/titanium_mobile/commit/91ddf8884ecc9...

    I thought maybe the NPE could be the context ref itself. But indeed maybe it's at the Bitmap level.

  2. Bill Dawson 2011-04-15

    Add'l commit to try to eliminate NPEs from null bitmap:
    http://github.com/appcelerator/titanium_mobile/commit/a750b594219fccef60906e5a886178da991b35dc"> http://github.com/appcelerator/titanium_mobile/commit/a750b594219fc...

  3. Bill Dawson 2011-04-15

    The last commit doesn't address the perhaps deeper problem as to why a bitmap might be null in the first place.

  4. Jeff Haynie 2011-04-15

    (from [a750b594219fccef60906e5a886178da991b35dc]) [#1507 status:open] Try to eliminate the occasional NPEs from background image loading by verifying bitmap is not null before accessing its properties http://github.com/appcelerator/titanium_mobile/commit/a750b594219fccef60906e5a886178da991b35dc"> http://github.com/appcelerator/titanium_mobile/commit/a750b594219fc...

  5. Junaid Younus 2012-08-20

    No test case, unable to reproduce and link doesn't work, marking ticket as invalid.
  6. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to the above comments.

JSON Source