File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
lib/java/com/google/android/material/internal Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,17 @@ public static ImageView getLogoImageView(@NonNull Toolbar toolbar) {
9090
9191 @ Nullable
9292 private static ImageView getImageView (@ NonNull Toolbar toolbar , @ Nullable Drawable content ) {
93+ if (content == null ) {
94+ return null ;
95+ }
9396 for (int i = 0 ; i < toolbar .getChildCount (); i ++) {
9497 View child = toolbar .getChildAt (i );
9598 if (child instanceof ImageView ) {
9699 ImageView imageView = (ImageView ) child ;
97- if (content != null
98- && imageView .getDrawable ().getConstantState ().equals (content .getConstantState ())) {
100+ Drawable drawable = imageView .getDrawable ();
101+ if (drawable != null
102+ && drawable .getConstantState () != null
103+ && drawable .getConstantState ().equals (content .getConstantState ())) {
99104 return imageView ;
100105 }
101106 }
You can’t perform that action at this time.
0 commit comments