Skip to content

Commit

Permalink
Throw a more helpful exception when a theme lacks a certain attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
xian committed Sep 22, 2016
1 parent 73f02cb commit e1909e9
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -433,6 +433,9 @@ public final class ShadowAssetManager {
ResName styleAttributeResName = getResName(set.getStyleAttribute());
while (styleAttributeResName.type.equals("attr")) {
AttributeResource attrValue = getOverlayedThemeValue(styleAttributeResName, theme, overlayedStyles);
if (attrValue == null) {
throw new NullPointerException("no value for " + styleAttributeResName.getFullyQualifiedName() + " in " + theme);

This comment has been minimized.

Copy link
@jongerrish

jongerrish Sep 26, 2016

Contributor

Would it be better to throw a Resources.NotFoundException here?

This comment has been minimized.

Copy link
@xian

xian Oct 19, 2016

Author Member

Yep, good point, I had thought it was a checked exception but it's not. I added a note to fix it here: https://www.pivotaltracker.com/story/show/132209019

}
if (attrValue.isResourceReference()) {
styleAttributeResName = attrValue.getResourceReference();
} else if (attrValue.isStyleReference()) {
Expand Down

0 comments on commit e1909e9

Please sign in to comment.