summaryrefslogtreecommitdiff
path: root/core/src/kz/ilotterytea/maxon/ui
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-06-09 15:25:14 +0500
committerilotterytea <iltsu@alright.party>2024-06-09 19:27:38 +0500
commit00ff1644e9c7620080664fd591051161af98bea4 (patch)
tree3b90757ee256665655d29dcc079510e1755d2aeb /core/src/kz/ilotterytea/maxon/ui
parent56d40d633445539b79b604584ffd41b7ff689e36 (diff)
fix: catch arrayindexoutofboundsexception
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/ui')
-rw-r--r--core/src/kz/ilotterytea/maxon/ui/AnimatedImage.java9
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++;
}