Skip to content

Commit

Permalink
fix: Don't crash on Android if data source throws Exception
Browse files Browse the repository at this point in the history
See immich-app/immich#15230 (comment).
So far, only java.lang.Error was caught, but
HttpDataSource.InvalidResponseCodeException is a java.lang.Exception.
  • Loading branch information
rovo89 committed Jan 10, 2025
1 parent ac78487 commit d381db6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class NativeVideoPlayerViewController(
if (error.cause == null) {
api.onError(Error("Unknown playback error occurred"))
} else {
api.onError(error.cause as Error)
api.onError(error.cause as Throwable)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class NativeVideoPlayerApi(
channel.invokeMethod("onPlaybackEnded", null)
}

fun onError(error: Error) {
fun onError(error: Throwable) {
channel.invokeMethod("onError", error.message)
}

Expand Down

0 comments on commit d381db6

Please sign in to comment.