Make context non nullable

An exception is currently thrown if context is null. Making context non
null means a null passed to the method will throw a similar exception.
pull/510/head
veyndan 6 years ago
parent 660a3eaa7a
commit e6e36299fa

@ -47,10 +47,8 @@ object PaletteUtils {
}
@JvmStatic
fun getColor(context: Context?, paletteColor: Int): Int {
fun getColor(context: Context, paletteColor: Int): Int {
var paletteColor = paletteColor
if (context == null)
throw IllegalArgumentException("Context is null")
val res = StyledResources(context)
val palette = res.palette

Loading…
Cancel
Save