@@ -377,7 +377,7 @@ private void loadFromAttributes(
377377 setChipIconVisible (a .getBoolean (R .styleable .Chip_chipIconVisible , false ));
378378 // If the user explicitly sets the deprecated attribute (chipIconEnabled) but NOT the
379379 // replacement attribute (chipIconVisible), use the value specified in the deprecated attribute.
380- if (attrs .getAttributeValue (NAMESPACE_APP , "chipIconEnabled" ) != null
380+ if (attrs != null && attrs .getAttributeValue (NAMESPACE_APP , "chipIconEnabled" ) != null
381381 && attrs .getAttributeValue (NAMESPACE_APP , "chipIconVisible" ) == null ) {
382382 setChipIconVisible (a .getBoolean (R .styleable .Chip_chipIconEnabled , false ));
383383 }
@@ -389,7 +389,7 @@ private void loadFromAttributes(
389389 // If the user explicitly sets the deprecated attribute (closeIconEnabled) but NOT the
390390 // replacement attribute (closeIconVisible), use the value specified in the deprecated
391391 // attribute.
392- if (attrs .getAttributeValue (NAMESPACE_APP , "closeIconEnabled" ) != null
392+ if (attrs != null && attrs .getAttributeValue (NAMESPACE_APP , "closeIconEnabled" ) != null
393393 && attrs .getAttributeValue (NAMESPACE_APP , "closeIconVisible" ) == null ) {
394394 setCloseIconVisible (a .getBoolean (R .styleable .Chip_closeIconEnabled , false ));
395395 }
@@ -403,7 +403,7 @@ private void loadFromAttributes(
403403 // If the user explicitly sets the deprecated attribute (checkedIconEnabled) but NOT the
404404 // replacement attribute (checkedIconVisible), use the value specified in the deprecated
405405 // attribute.
406- if (attrs .getAttributeValue (NAMESPACE_APP , "checkedIconEnabled" ) != null
406+ if (attrs != null && attrs .getAttributeValue (NAMESPACE_APP , "checkedIconEnabled" ) != null
407407 && attrs .getAttributeValue (NAMESPACE_APP , "checkedIconVisible" ) == null ) {
408408 setCheckedIconVisible (a .getBoolean (R .styleable .Chip_checkedIconEnabled , false ));
409409 }
0 commit comments