Skip to content

Commit

Permalink
Fixed IndexOutOfBoundsException for leak traces of size 1
Browse files Browse the repository at this point in the history
Fixes #1135
  • Loading branch information
pyricau committed Jan 10, 2019
1 parent a7ae33c commit 4ccfa3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [#1153](https://github.com/square/leakcanary/issues/1153) `LeakCanary.isInAnalyzerProcess` now correctly returns true in the analyzer process prior to any first leak (could be triggered by starting the leak result activity).
* [#1158](https://github.com/square/leakcanary/issues/1158) Stopped enabling DisplayLeakActivity when not using DisplayLeakService.
* [#1135](https://github.com/square/leakcanary/issues/1135) Fixed IndexOutOfBoundsException for leak traces of size 1.


## Version 1.6.2 (2018-10-16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ private DisplayLeakConnectorView.Type getConnectorType(int position) {
if (position == 1) {
return DisplayLeakConnectorView.Type.HELP;
} else if (position == 2) {
if (leakTrace.expectedReachability.size() == 1) {
return DisplayLeakConnectorView.Type.START_LAST_REACHABLE;
}
Reachability nextReachability =
leakTrace.expectedReachability.get(elementIndex(position + 1));
if (nextReachability != Reachability.REACHABLE) {
Expand Down

0 comments on commit 4ccfa3c

Please sign in to comment.