[Android] Fix Uninitialized exception on the remote access server

Nicolas Pomepuy git at videolan.org
Thu Apr 25 12:22:35 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Apr 24 10:06:55 2024 +0200| [dcc157e376871497b4f9840bb1087caa1c82542a] | committer: Duncan McNamara

Fix Uninitialized exception on the remote access server

> https://code.videolan.org/videolan/vlc-android/commit/dcc157e376871497b4f9840bb1087caa1c82542a
---

 .../src/main/java/org/videolan/vlc/webserver/RemoteAccessService.kt      | 1 +
 1 file changed, 1 insertion(+)

diff --git a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessService.kt b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessService.kt
index 7007e6adc0..11b093a1e9 100644
--- a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessService.kt
+++ b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessService.kt
@@ -55,6 +55,7 @@ class RemoteAccessService : LifecycleService() {
     private val receiver = object : BroadcastReceiver() {
         @SuppressLint("WakelockTimeout")
         override fun onReceive(context: Context, intent: Intent) {
+            if (!::server.isInitialized) return
             when (intent.action) {
                 ACTION_STOP_SERVER -> {
                     lifecycleScope.launch { server.stop() }



More information about the Android mailing list