mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
This commit is contained in:
parent
cfec557ff0
commit
ce8259e20a
1 changed files with 1 additions and 2 deletions
|
|
@ -2023,8 +2023,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
+ "Current thread: '%s'\n"
|
+ "Current thread: '%s'\n"
|
||||||
+ "Expected thread: '%s'\n"
|
+ "Expected thread: '%s'\n"
|
||||||
+ "See https://exoplayer.dev/issues/player-accessed-on-wrong-thread",
|
+ "See https://exoplayer.dev/issues/player-accessed-on-wrong-thread",
|
||||||
Looper.myLooper().getThread().getName(),
|
Thread.currentThread().getName(), getApplicationLooper().getThread().getName());
|
||||||
getApplicationLooper().getThread().getName());
|
|
||||||
if (throwsWhenUsingWrongThread) {
|
if (throwsWhenUsingWrongThread) {
|
||||||
throw new IllegalStateException(message);
|
throw new IllegalStateException(message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue