Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
322
Issues
322
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-Android
Commits
95ec1882
Commit
95ec1882
authored
Jun 13, 2016
by
Geoffrey Métais
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid NPE in MediaInfoFragment
parent
edf73f54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
...oid/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+10
-11
No files found.
vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
View file @
95ec1882
...
...
@@ -173,9 +173,10 @@ public class MediaInfoFragment extends ListFragment {
@Override
public
void
run
()
{
File
itemFile
=
new
File
(
Uri
.
decode
(
mItem
.
getLocation
().
substring
(
5
)));
if
(!
itemFile
.
canWrite
())
if
(!
itemFile
.
canWrite
()
&&
mHandler
!=
null
)
mHandler
.
obtainMessage
(
HIDE_DELETE
).
sendToTarget
();
long
length
=
itemFile
.
length
();
if
(
mHandler
!=
null
)
mHandler
.
obtainMessage
(
NEW_SIZE
,
Long
.
valueOf
(
length
)).
sendToTarget
();
if
(
mItem
.
getType
()
==
MediaWrapper
.
TYPE_VIDEO
)
checkSubtitles
(
itemFile
);
...
...
@@ -214,10 +215,8 @@ public class MediaInfoFragment extends ListFragment {
if
(!
Extensions
.
SUBTITLES
.
contains
(
extension
))
continue
;
if
(
mHandler
==
null
||
Thread
.
interrupted
())
{
if
(
mHandler
==
null
||
Thread
.
interrupted
())
return
;
}
if
(
filename
.
startsWith
(
videoName
))
{
mHandler
.
obtainMessage
(
SHOW_SUBTITLES
).
sendToTarget
();
return
;
...
...
@@ -245,6 +244,7 @@ public class MediaInfoFragment extends ListFragment {
mMedia
=
new
Media
(
libVlc
,
mItem
.
getUri
());
mMedia
.
parse
();
if
(
mHandler
!=
null
)
mHandler
.
sendEmptyMessage
(
NEW_TEXT
);
DisplayMetrics
screen
=
new
DisplayMetrics
();
...
...
@@ -272,10 +272,8 @@ public class MediaInfoFragment extends ListFragment {
}
else
return
;
if
(
mHandler
==
null
||
Thread
.
interrupted
())
{
if
(
mHandler
==
null
||
Thread
.
interrupted
())
return
;
}
mHandler
.
sendEmptyMessage
(
NEW_IMAGE
);
}
};
...
...
@@ -308,7 +306,7 @@ public class MediaInfoFragment extends ListFragment {
mAdapter
.
add
(
track
);
}
if
(
hasSubs
)
if
(
hasSubs
&&
mHandler
!=
null
)
mHandler
.
obtainMessage
(
SHOW_SUBTITLES
).
sendToTarget
();
}
...
...
@@ -324,6 +322,7 @@ public class MediaInfoFragment extends ListFragment {
public
void
run
()
{
FileUtils
.
deleteFile
(
mItem
.
getUri
().
getPath
());
MediaDatabase
.
getInstance
().
removeMedia
(
mItem
.
getUri
());
if
(
mHandler
!=
null
)
mHandler
.
sendEmptyMessage
(
EXIT
);
}
});
...
...
Geoffrey Métais
@Dekans
mentioned in commit
d89cceb0
·
Jun 14, 2016
mentioned in commit
d89cceb0
mentioned in commit d89cceb04ac93dd765360e1018ae026ff8126ddc
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment