From eec125579f2ecc6f6e45095861ef3e1c9b06bfb7 Mon Sep 17 00:00:00 2001 From: Pixee OSS Assistant <148879594+pixeeai@users.noreply.github.com> Date: Thu, 25 Apr 2024 05:15:32 -0400 Subject: [PATCH] chore(android): switch order of literals to prevent NullPointerException (#3711) Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> --- .../com/brentvatne/exoplayer/ReactExoplayerView.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 24bf159d..6d0d43eb 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1642,10 +1642,10 @@ public class ReactExoplayerView extends FrameLayout implements type = "default"; } - if (type.equals("disabled")) { + if ("disabled".equals(type)) { disableTrack(rendererIndex); return; - } else if (type.equals("language")) { + } else if ("language".equals(type)) { for (int i = 0; i < groups.length; ++i) { Format format = groups.get(i).getFormat(0); if (format.language != null && format.language.equals(value)) { @@ -1653,7 +1653,7 @@ public class ReactExoplayerView extends FrameLayout implements break; } } - } else if (type.equals("title")) { + } else if ("title".equals(type)) { for (int i = 0; i < groups.length; ++i) { Format format = groups.get(i).getFormat(0); if (format.id != null && format.id.equals(value)) { @@ -1661,12 +1661,12 @@ public class ReactExoplayerView extends FrameLayout implements break; } } - } else if (type.equals("index")) { + } else if ("index".equals(type)) { int iValue = Integer.parseInt(value); if (iValue < groups.length) { groupIndex = iValue; } - } else if (type.equals("resolution")) { + } else if ("resolution".equals(type)) { int height = Integer.parseInt(value); for (int i = 0; i < groups.length; ++i) { // Search for the exact height TrackGroup group = groups.get(i);