Prevent crashes if wallpapercolors are null

This commit is contained in:
Till Kottmann
2018-09-09 14:29:07 +02:00
parent dd715aef14
commit 9a3ecaf6de

View File

@@ -60,7 +60,7 @@ public class WallpaperColorInfoVOMR1 extends WallpaperColorInfo implements OnCol
@Override
public int getActualMainColor() {
return mColors.getPrimaryColor().toArgb();
return mColors == null ? -1 : mColors.getPrimaryColor().toArgb();
}
@Override
@@ -70,13 +70,13 @@ public class WallpaperColorInfoVOMR1 extends WallpaperColorInfo implements OnCol
@Override
public int getActualSecondaryColor() {
Color secondary = mColors.getSecondaryColor();
Color secondary = mColors == null ? null : mColors.getSecondaryColor();
return secondary == null ? -1 : secondary.toArgb();
}
@Override
public int getTertiaryColor() {
Color tertiary = mColors.getTertiaryColor();
Color tertiary = mColors == null ? null : mColors.getTertiaryColor();
return tertiary == null ? -1 : tertiary.toArgb();
}