File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
android/src/main/java/com/orientationdirector Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,27 @@ class OrientationDirectorModule(reactContext: ReactApplicationContext) :
5050 }
5151
5252 override fun sendOnDeviceOrientationChanged (params : WritableMap ) {
53- emitOnDeviceOrientationChanged(params)
53+ try {
54+ emitOnDeviceOrientationChanged(params)
55+ } catch (_: Exception ) {
56+ // No listener instance yet
57+ }
5458 }
5559
5660 override fun sendOnInterfaceOrientationChanged (params : WritableMap ) {
57- emitOnInterfaceOrientationChanged(params)
61+ try {
62+ emitOnInterfaceOrientationChanged(params)
63+ } catch (_: Exception ) {
64+ // No listener instance yet
65+ }
5866 }
5967
6068 override fun sendOnLockChanged (params : WritableMap ) {
61- emitOnLockChanged(params)
69+ try {
70+ emitOnLockChanged(params)
71+ } catch (_: Exception ) {
72+ // No listener instance yet
73+ }
6274 }
6375
6476 companion object {
You can’t perform that action at this time.
0 commit comments