OSDN Git Service
(root)
/
android-x86
/
frameworks-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29dc496
)
Check for null drawable in theme-less getDrawable()
author
Alan Viverette
<alanv@google.com>
Mon, 24 Nov 2014 19:27:09 +0000
(11:27 -0800)
committer
Alan Viverette
<alanv@google.com>
Mon, 24 Nov 2014 19:27:09 +0000
(11:27 -0800)
BUG:
18507509
Change-Id: I64e2950dc3a30f3979ec179789a6f6e055c9f86d
core/java/android/content/res/Resources.java
patch
|
blob
|
history
diff --git
a/core/java/android/content/res/Resources.java
b/core/java/android/content/res/Resources.java
index
0145e05
..
78d3e9c
100644
(file)
--- a/
core/java/android/content/res/Resources.java
+++ b/
core/java/android/content/res/Resources.java
@@
-747,7
+747,7
@@
public class Resources {
*/
public Drawable getDrawable(int id) throws NotFoundException {
final Drawable d = getDrawable(id, null);
- if (d.canApplyTheme()) {
+ if (d
!= null && d
.canApplyTheme()) {
Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme "
+ "attributes! Consider using Resources.getDrawable(int, Theme) or "
+ "Context.getDrawable(int).", new RuntimeException());