Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25186] Android: Crash when clicking on label with SpannedString content

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-08-23T21:56:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsandroid
Reportergrebulon
AssigneeGary Mathews
Created2017-08-22T10:15:12.000+0000
Updated2017-08-28T21:40:53.000+0000

Description

TiUILabel sometimes crashes (rare) in onTouchEvent when clicking on a html link. The bug is that the code calls: Layout layout = textView.getLayout(); there is no test for: layout != null getLayout() can return null as described in the documentation. It's hard to reproduce because the content of the textView has to change right before the click.

Comments

  1. Hans Knöchel 2017-08-22

    Hey [~buddyguards], thank you for bringing this up! So this did not happen on SDK 6.1.1 and earlier? And as you already proposed a solution, may you be able to file a PR for the changed line as well? If not, our engineers will take care of it. Thank you!
  2. Gary Mathews 2017-08-22

    master: https://github.com/appcelerator/titanium_mobile/pull/9340 6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9341
  3. Gary Mathews 2017-08-22

    [~hknoechel] I haven't assigned a fixVersion, not sure if this is going in 6.2.0 ?
  4. Hans Knöchel 2017-08-22

    Should be save to take! Adding guards in this case cannot harm :).
  5. Abir Mukherjee 2017-08-23

    Passed FR. I tried on two phones: *Android 7.1.2*: I was not able to reproduce the crash on the affected version. I did not see any crashes with the 6.2.0 fixVersion. I tried 200 times with each version. *Android 4.4.4* : I tried approximately 200 times with 6.2.0 and did not see any crashes. With 6.1.2.GA, I did see a crash after about 50 tries. I then tried another 300 times on 6.1.2.GA but did not see a crash. Although I was not able to consistently reproduce the issue on the affected version, I did not see any crash on the 6.2.0 fixVersion.
  6. Abir Mukherjee 2017-08-28

    Changes are in SDKs: 6.2.0.v20170827172423 7.0.0.v20170828071347

JSON Source