Commit b9b405ef by kimvde Committed by bachinger

Avoid NPEs when checking the current thread in SimpleExoPlayer

Before, Looper.myLooper().getThread() could throw an NPE if the current
thread didn't have any looper.

#minor-release

PiperOrigin-RevId: 371097485
parent 8fa90b4c
......@@ -2023,8 +2023,7 @@ public class SimpleExoPlayer extends BasePlayer
+ "Current thread: '%s'\n"
+ "Expected thread: '%s'\n"
+ "See https://exoplayer.dev/issues/player-accessed-on-wrong-thread",
Looper.myLooper().getThread().getName(),
getApplicationLooper().getThread().getName());
Thread.currentThread().getName(), getApplicationLooper().getThread().getName());
if (throwsWhenUsingWrongThread) {
throw new IllegalStateException(message);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment