fix TextView::setTextColor(nullptr)'s crash

This commit is contained in:
houzh 2023-11-27 14:22:49 +08:00
parent 947ea9d34b
commit cf1673f325

View File

@ -1582,9 +1582,10 @@ void TextView::invalidateDrawable(Drawable& drawable){
void TextView::updateTextColors(){
bool inval = false;
int color;
const std::vector<int>&drawableState = getDrawableState();
if (mCurTextColor) {
const int color = mTextColor->getColorForState(drawableState,0);
color = mTextColor->getColorForState(drawableState,0);
LOGV("%p:%d change color %x->%x",this,mID,color,mCurTextColor);
mCurTextColor = color;
inval = true;