[Android] Remote access: minor code quality and null-safety fixes
Nicolas Pomepuy
git at videolan.org
Thu Sep 10 04:41:21 UTC 2026
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Sep 9 15:07:51 2026 +0200| [45684c4323e58fa34eb03f83e06044be6faf735f] | committer: Nicolas Pomepuy
Remote access: minor code quality and null-safety fixes
> https://code.videolan.org/videolan/vlc-android/commit/45684c4323e58fa34eb03f83e06044be6faf735f
---
.../routing/RemoteAccessRoutingResources.kt | 4 +++-
.../remoteaccessserver/routing/RemoteAccessRoutingUtils.kt | 11 ++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingResources.kt b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingResources.kt
index d0406e670c..7d9129029d 100644
--- a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingResources.kt
+++ b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingResources.kt
@@ -57,6 +57,8 @@ import org.videolan.vlc.util.slugify
import org.videolan.vlc.util.toByteArray
import java.io.File
+private const val TAG = "RARoutingResources"
+
fun Route.resourceRouting(appContext: Context, settings: SharedPreferences) {
// Download a media file
get("/prepare-download") {
@@ -364,7 +366,7 @@ fun Route.resourceRouting(appContext: Context, settings: SharedPreferences) {
}
}
} catch (e: Exception) {
- Log.e("networkShareReplace", e.message, e)
+ Log.e(TAG, e.message, e)
}
call.respond(HttpStatusCode.NotFound, "")
}
diff --git a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingUtils.kt b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingUtils.kt
index c3f8089483..24ba94a5d7 100644
--- a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingUtils.kt
+++ b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingUtils.kt
@@ -90,11 +90,12 @@ internal suspend fun getLogsFiles(context: Context): List<LogFile> = withContext
result.add(LogFile(it.path, if (it.name.startsWith("vlc_logcat_remote_access")) "web" else "device", Date(it.lastModified())))
}
- val crashFolder = File(context.getExternalFilesDir(null)!!.absolutePath)
- val crashFiles = crashFolder.listFiles()
- crashFiles?.forEach {
- if (it.isFile && it.name.startsWith("vlc_crash"))
- result.add(LogFile(it.path, "crash", Date(it.lastModified())))
+ context.getExternalFilesDir(null)?.let { crashFolder ->
+ val crashFiles = crashFolder.listFiles()
+ crashFiles?.forEach {
+ if (it.isFile && it.name.startsWith("vlc_crash"))
+ result.add(LogFile(it.path, "crash", Date(it.lastModified())))
+ }
}
return at withContext result
More information about the Android
mailing list