From 756bbc96f0945fa2de7dfdc5d156bc3be0a680fa Mon Sep 17 00:00:00 2001 From: sridhar Date: Thu, 20 Dec 2018 11:01:13 +0530 Subject: [PATCH] Defect fix Defect fix --- .../com/brentvatne/exoplayer/ReactExoplayerView.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 262d6240..691b7d8a 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -870,14 +870,16 @@ class ReactExoplayerView extends FrameLayout implements /*0 is auto mode. Add all tracks of group 0*/ if (0 == value.asInt()) { - TrackGroup group = groups.get(0); + if (groups.length > 0) { + TrackGroup group = groups.get(0); - tracks = new int[group.length]; + tracks = new int[group.length]; - groupIndex = 0; + groupIndex = 0; - for (int j = 0; j < group.length; j++) { - tracks[j] = j; + for (int j = 0; j < group.length; j++) { + tracks[j] = j; + } } } else { /*Search for the exact video Height*/