There two different ways(code1 and code2 ) to get drawable instance in imageview. In theory, they are the same, but code2 will crash after dexguard obfuscation.
// code1 if(imageView == null) return val drawable = imageView.drawable ?: ColorDrawable(Color.LTGRAY)
// code2 val drawable = imageView?.drawable ?: ColorDrawable(Color.LTGRAY)
I have pushed an demo project which can reproduce this crash to github, the repository url is