Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
530
Issue boards
Milestones
Wiki
Code
Merge requests
15
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
fd165128
Commit
fd165128
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
BitmapUtil: Prevent NPE on app startup
parent
b74887c6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/helpers/BitmapUtil.java
+7
-7
7 additions, 7 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/BitmapUtil.java
with
7 additions
and
7 deletions
vlc-android/src/org/videolan/vlc/gui/helpers/BitmapUtil.java
+
7
−
7
View file @
fd165128
...
...
@@ -100,8 +100,8 @@ public class BitmapUtil {
private
static
Bitmap
fetchPicture
(
MediaWrapper
media
)
{
final
BitmapCache
cache
=
BitmapCache
.
getInstance
();
Bitmap
picture
=
readCoverBitmap
(
media
.
getArtworkURL
());
cache
.
addBitmapToMemCache
(
media
.
getLocation
(),
picture
);
final
Bitmap
picture
=
readCoverBitmap
(
media
.
getArtworkURL
());
if
(
picture
!=
null
)
cache
.
addBitmapToMemCache
(
media
.
getLocation
(),
picture
);
return
picture
;
}
...
...
@@ -114,12 +114,12 @@ public class BitmapUtil {
}
private
static
Bitmap
readCoverBitmap
(
String
path
)
{
if
(
path
==
null
)
return
null
;
Resources
res
=
VLCApplication
.
getAppResources
();
if
(
path
==
null
)
return
null
;
final
Context
ctx
=
VLCApplication
.
getAppContext
();
if
(
ctx
==
null
)
return
null
;
final
Resources
res
=
ctx
.
getResources
();
String
uri
=
Uri
.
decode
(
path
);
if
(
uri
.
startsWith
(
"file://"
))
uri
=
uri
.
substring
(
7
);
if
(
uri
.
startsWith
(
"file://"
))
uri
=
uri
.
substring
(
7
);
Bitmap
cover
=
null
;
BitmapFactory
.
Options
options
=
new
BitmapFactory
.
Options
();
int
height
=
res
.
getDimensionPixelSize
(
R
.
dimen
.
grid_card_thumb_height
);
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
aba39430
·
6 years ago
mentioned in commit
aba39430
mentioned in commit aba394305a76c113dc5ee09b0550b50de80d8a6f
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