Unverified Commit 4fb8aac1 authored by Roman Sedaikin's avatar Roman Sedaikin Committed by GitHub

Throw an exception if the user tries to create a SkiaLayer with an...

Throw an exception if the user tries to create a SkiaLayer with an inappropriate [renderApi] on the current OS. (#506)

* Throw an exception if the user tries to create a SkiaLayer with an inappropriate [renderApi] on the current OS.

see: https://github.com/JetBrains/skiko/issues/493
parent 8d61a57a
......@@ -71,9 +71,10 @@ internal object SkikoProperties {
}
val indexOfInitialApi = fallbackApis.indexOf(initialApi)
if (indexOfInitialApi >= 0) {
fallbackApis = fallbackApis.drop(indexOfInitialApi + 1)
require(indexOfInitialApi >= 0) {
"$hostOs does not support $initialApi rendering API."
}
fallbackApis = fallbackApis.drop(indexOfInitialApi + 1)
return listOf(initialApi) + fallbackApis
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment