diff options
| author | ilotterytea <iltsu@alright.party> | 2024-06-09 15:25:14 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-06-09 19:27:38 +0500 |
| commit | 00ff1644e9c7620080664fd591051161af98bea4 (patch) | |
| tree | 3b90757ee256665655d29dcc079510e1755d2aeb /core/src/kz/ilotterytea | |
| parent | 56d40d633445539b79b604584ffd41b7ff689e36 (diff) | |
fix: catch arrayindexoutofboundsexception
Diffstat (limited to 'core/src/kz/ilotterytea')
| -rw-r--r-- | core/src/kz/ilotterytea/maxon/ui/AnimatedImage.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/kz/ilotterytea/maxon/ui/AnimatedImage.java b/core/src/kz/ilotterytea/maxon/ui/AnimatedImage.java index 097fb2b..19ec0dc 100644 --- a/core/src/kz/ilotterytea/maxon/ui/AnimatedImage.java +++ b/core/src/kz/ilotterytea/maxon/ui/AnimatedImage.java @@ -22,9 +22,12 @@ public class AnimatedImage extends Image implements Disposable { if (index > regions.length - 1) { index = 0; } - if (regions[index + 1] == null) { - index = 0; - } + try { + if (regions[index + 1] == null) { + index = 0; + } + } catch (ArrayIndexOutOfBoundsException ignored) {} + super.setDrawable(new TextureRegionDrawable(regions[index])); index++; } |
