Skip to content

Commit

Permalink
fixes unhandled NullPointerException for styleOperations
Browse files Browse the repository at this point in the history
  • Loading branch information
matejbart committed Oct 30, 2023
1 parent 891503f commit 58f42be
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun getFallbackStyleOnlineUri(mapType: Int) = when (mapType) {

fun MapStyleOptions.apply(style: JSONObject) {
try {
Gson().fromJson(json, Array<StyleOperation>::class.java).let { styleOperations ->
Gson().fromJson(json, Array<StyleOperation>::class.java)?.let { styleOperations ->

val layerArray = style.getJSONArray(KEY_LAYERS)

Expand Down

0 comments on commit 58f42be

Please sign in to comment.