react-native-sheet2 1.1.22 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,18 +19,22 @@ class TopModalViewModule(reactContext: ReactApplicationContext) : ReactContextBa
19
19
  return TAG
20
20
  }
21
21
 
22
- private fun findSheetView(viewId: Int): TopModalView {
22
+ private fun findSheetView(viewId: Int): TopModalView? {
23
23
  Log.d(TAG, "Finding view $viewId...")
24
24
  val view = if (reactApplicationContext != null) UIManagerHelper.getUIManager(reactApplicationContext, viewId)?.resolveView(viewId) as TopModalView? else null
25
25
  Log.d(TAG, if (reactApplicationContext != null) "Found view $viewId!" else "Couldn't find view $viewId!")
26
- return view ?: throw RuntimeException("ViewNotFound($viewId)")
26
+ return view
27
27
  }
28
28
 
29
29
  @ReactMethod
30
30
  fun dismiss(viewTag: Int) {
31
31
  Handler(Looper.getMainLooper()).post {
32
- val view = findSheetView(viewTag)
33
- view.dismiss()
32
+ try {
33
+ val view = findSheetView(viewTag)
34
+ view?.dismiss()
35
+ } catch (_: Throwable) {
36
+
37
+ }
34
38
  }
35
39
  }
36
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-sheet2",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "description": "Native implementation of Bottom sheet",
5
5
  "main": "src/index",
6
6
  "module": "src/index",