Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
196ab52f
Commit
196ab52f
authored
5 months ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Prevent crash on IOException
Fixes #3084
parent
c56c2a9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1973
Crash fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
application/vlc-android/src/org/videolan/vlc/FileProvider.kt
+9
-1
9 additions, 1 deletion
application/vlc-android/src/org/videolan/vlc/FileProvider.kt
with
9 additions
and
1 deletion
application/vlc-android/src/org/videolan/vlc/FileProvider.kt
+
9
−
1
View file @
196ab52f
...
...
@@ -5,11 +5,13 @@ import android.content.ContentValues
import
android.database.Cursor
import
android.net.Uri
import
android.os.ParcelFileDescriptor
import
android.util.Log
import
org.videolan.medialibrary.interfaces.Medialibrary
import
org.videolan.resources.AndroidDevices
import
org.videolan.resources.AppContextProvider
import
java.io.File
import
java.io.FileNotFoundException
import
java.io.IOException
private
const
val
TAG
=
"VLC/FileProvider"
private
const
val
THUMB_PROVIDER_AUTHORITY
=
"${BuildConfig.APP_ID}.thumbprovider"
...
...
@@ -58,6 +60,12 @@ fun getUpdateUri() = Uri.Builder()
.
build
()
!!
fun
isPathValid
(
path
:
String
):
Boolean
{
val
file
=
File
(
path
)
val
file
=
try
{
File
(
path
)
}
catch
(
e
:
IOException
)
{
Log
.
e
(
TAG
,
"Failed to parse path: $path"
)
Log
.
e
(
TAG
,
e
.
message
,
e
)
return
false
}
return
AndroidDevices
.
mountBL
.
any
{
file
.
canonicalPath
.
startsWith
(
it
)
}
&&
file
.
canRead
()
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment