diff --git a/lib/src/android/support/design/widget/ThemeUtils.java b/lib/src/android/support/design/widget/ThemeUtils.java index 1716dfabf..87da3ab85 100644 --- a/lib/src/android/support/design/widget/ThemeUtils.java +++ b/lib/src/android/support/design/widget/ThemeUtils.java @@ -28,9 +28,8 @@ class ThemeUtils { static void checkAppCompatTheme(Context context) { TypedArray a = context.obtainStyledAttributes(APPCOMPAT_CHECK_ATTRS); final boolean failed = !a.hasValue(0); - if (a != null) { - a.recycle(); - } + a.recycle(); + if (failed) { throw new IllegalArgumentException( "You need to use a Theme.AppCompat theme " + "(or descendant) with the design library.");