Skip to content

Commit

Permalink
fix(android): Handle null value in setMenuCustomItems method (#3375)
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ai committed May 11, 2024
1 parent 5e8159f commit ccefcf1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,12 @@ class RNCWebViewManagerImpl {
}
}

fun setMenuCustomItems(viewWrapper: RNCWebViewWrapper, value: ReadableArray) {
fun setMenuCustomItems(viewWrapper: RNCWebViewWrapper, value: ReadableArray?) {
val view = viewWrapper.webView
view.setMenuCustomItems(value.toArrayList() as List<Map<String, String>>)
when (value) {
null -> view.setMenuCustomItems(null)
else -> view.setMenuCustomItems(value.toArrayList() as List<Map<String, String>>)
}
}

fun setNestedScrollEnabled(viewWrapper: RNCWebViewWrapper, value: Boolean) {
Expand Down

0 comments on commit ccefcf1

Please sign in to comment.