Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
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
57db5b98
Commit
57db5b98
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
SendCrashActivity: Prevent NPE
parent
658a5f19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#10006
failed with stage
in 2 minutes and 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/SendCrashActivity.kt
+14
-4
14 additions, 4 deletions
vlc-android/src/org/videolan/vlc/gui/SendCrashActivity.kt
with
14 additions
and
4 deletions
vlc-android/src/org/videolan/vlc/gui/SendCrashActivity.kt
+
14
−
4
View file @
57db5b98
...
...
@@ -83,6 +83,10 @@ class SendCrashActivity : AppCompatActivity(), DebugLogService.Client.Callback,
launch
(
start
=
CoroutineStart
.
UNDISPATCHED
)
{
val
emailIntent
=
withContext
(
Dispatchers
.
IO
)
{
client
.
stop
()
if
(!
::
logcatZipPath
.
isInitialized
)
{
val
path
=
VLCApplication
.
appContext
.
getExternalFilesDir
(
null
)
?.
absolutePath
?:
return
@withContext
null
logcatZipPath
=
"$path/logcat.zip"
}
FileUtils
.
zip
(
arrayOf
(
path
),
logcatZipPath
)
val
emailIntent
=
Intent
(
Intent
.
ACTION_SEND_MULTIPLE
)
...
...
@@ -91,6 +95,12 @@ class SendCrashActivity : AppCompatActivity(), DebugLogService.Client.Callback,
val
attachments
=
ArrayList
<
Uri
>()
if
(
binding
.
includeMedialibSwitch
.
isChecked
)
{
if
(
StoragePermissionsDelegate
.
getStoragePermission
(
this
@SendCrashActivity
,
true
))
{
if
(!
::
dbPath
.
isInitialized
)
{
val
path
=
VLCApplication
.
appContext
.
getExternalFilesDir
(
null
)
?.
absolutePath
?:
return
@withContext
null
dbPath
=
"$path/${AbstractMedialibrary.VLC_MEDIA_DB_NAME}"
dbZipPath
=
"$path/db.zip"
}
val
db
=
File
(
getDir
(
"db"
,
Context
.
MODE_PRIVATE
).
toString
()
+
AbstractMedialibrary
.
VLC_MEDIA_DB_NAME
)
val
dbFile
=
File
(
dbPath
)
FileUtils
.
copyFile
(
db
,
dbFile
)
...
...
@@ -131,16 +141,16 @@ class SendCrashActivity : AppCompatActivity(), DebugLogService.Client.Callback,
emailIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
emailIntent
}
startActivity
(
emailIntent
)
emailIntent
?.
let
{
startActivity
(
it
)
}
finish
()
}
}
private
lateinit
var
client
:
DebugLogService
.
Client
private
lateinit
var
binding
:
SendCrashActivityBinding
private
val
dbPath
=
VLCApplication
.
appContext
.
getExternalFilesDir
(
null
)
!!
.
absolutePath
+
"/"
+
AbstractMedialibrary
.
VLC_MEDIA_DB_NAME
private
va
l
dbZipPath
=
VLCApplication
.
appContext
.
getExternalFilesDir
(
null
)
!!
.
absolutePath
+
"/"
+
"db.zip"
private
va
l
logcatZipPath
=
VLCApplication
.
appContext
.
getExternalFilesDir
(
null
)
!!
.
absolutePath
+
"/"
+
"logcat.zip"
private
lateinit
var
dbPath
:
String
private
lateinit
va
r
dbZipPath
:
String
private
lateinit
va
r
logcatZipPath
:
String
private
lateinit
var
errMsg
:
String
private
lateinit
var
errCtx
:
String
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
fede2baa
·
5 years ago
mentioned in commit
fede2baa
mentioned in commit fede2baadb7ff3cc581e6a8e6540240334108d0f
Toggle commit list
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