[TIMOB-25186] Android: Crash when clicking on label with SpannedString content
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-23T21:56:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.2.0 |
Components | Android |
Labels | android |
Reporter | grebulon |
Assignee | Gary Mathews |
Created | 2017-08-22T10:15:12.000+0000 |
Updated | 2017-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.
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!
master: https://github.com/appcelerator/titanium_mobile/pull/9340 6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9341
[~hknoechel] I haven't assigned a fixVersion, not sure if this is going in
6.2.0
?Should be save to take! Adding guards in this case cannot harm :).
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.
Changes are in SDKs: 6.2.0.v20170827172423 7.0.0.v20170828071347