Fixed crash when trying to tint null background on Lollipop

This commit is contained in:
Moez Bhatti
2018-04-15 22:08:09 -04:00
parent 22eeba16fc
commit a9ba7434e8
@@ -41,7 +41,7 @@ fun View.setBackgroundTint(color: Int) {
// API 21 doesn't support this
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) {
background.setColorFilter(color, PorterDuff.Mode.SRC_ATOP)
background?.setColorFilter(color, PorterDuff.Mode.SRC_ATOP)
}
backgroundTintList = ColorStateList.valueOf(color)