Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in react native with realm 10.19.3 crashes when one or some of object properties has null value #4682

Closed
takanorihirai opened this issue Jun 28, 2022 · 4 comments · Fixed by #4684

Comments

@takanorihirai
Copy link

takanorihirai commented Jun 28, 2022

How frequently does the bug occur?

Sometimes

Description

on realm 10.19.3, react native app crashes with errors:

trace screen shows the location:
node_modules/realm/lib/extensions.js line 117
https://github.com/realm/realm-js/blob/v10.19.3/lib/extensions.js#L117

value[symbols.IS_PROXIED_DICTIONARY]

when one or some of properties of realm object is null, value of the 'extensions.js' is also null, so it maybe cause error.
i tried in a source so the properties of object has no null value,escaped crash ,
but other source calls other realm object which has null property, and cause same crash.

solution maybe (but it's not maybe smart) :
https://github.com/realm/realm-js/blob/v10.19.3/lib/extensions.js#L106

          // skip any functions & constructors (in case of class models).
          if (typeof value === "function") {
            return; // continue
          }

+ if ( value === null ) {
+  result[key] = value;
+ return;
+ }

versions in package.json of project:

        "react": "17.0.2",
        "react-native": "0.63.4",
...
        "react-redux": "^7.2.6",
        "react-statics-styles": "^3.1.0",
        "react-tween-state": "^0.1.5",
        "react-use": "^17.4.0",
        "realm": "^10.19.3",
        "redux": "^4.1.2",
        "redux-persist": "^6.0.0",
        "redux-saga": "^1.1.3",

Simulator Screen Shot - iPhone 11 - 2022-06-28 at 19 17 20

Stacktrace & log output

[Tue Jun 28 2022 19:15:19.965]  ERROR    TypeError: null is not an object (evaluating 'value[_$$_REQUIRE(_dependencyMap[5], "@realm.io/common").symbols.IS_PROXIED_DICTIONARY]')

This error is located at:
    in HomeScreen (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:245)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:244)
    in RCTView (at View.js:34)
    in View (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:573)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:549)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
    in RCTView (at View.js:34)
    in View (at Card.tsx:538)
    in Card (at CardContainer.tsx:206)
    in CardContainer (at CardStack.tsx:623)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at Screens.tsx:74)
    in MaybeScreen (at CardStack.tsx:616)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at Screens.tsx:50)
    in MaybeScreenContainer (at CardStack.tsx:498)
    in CardStack (at StackView.tsx:462)
    in KeyboardManager (at StackView.tsx:458)
    in SafeAreaProviderCompat (at StackView.tsx:455)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at StackView.tsx:454)
    in StackView (at createStackNavigator.tsx:87)
    in StackNavigator (at homeStack.js:23)
    in HomeStack (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at BottomTabView.tsx:55)
    in SceneContent (at BottomTabView.tsx:172)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at ResourceSavingScene.tsx:30)
    in ResourceSavingScene (at BottomTabView.tsx:166)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at BottomTabView.tsx:146)
    in SafeAreaProviderCompat (at BottomTabView.tsx:145)
    in BottomTabView (at createBottomTabNavigator.tsx:45)
    in BottomTabNavigator (at tabNavigator/index.js:17)
    in TabNavigator (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at ResourceSavingScene.tsx:30)
    in ResourceSavingScene (at DrawerView.tsx:203)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at DrawerView.tsx:182)
    in RCTView (at View.js:34)
    in View (at Drawer.tsx:625)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:444)
    in AnimatedComponent(View) (at createAnimatedComponent.js:455)
    in ForwardRef(AnimatedComponentWrapper) (at Drawer.tsx:618)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:444)
    in AnimatedComponent(View) (at createAnimatedComponent.js:455)
    in ForwardRef(AnimatedComponentWrapper) (at Drawer.tsx:608)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Drawer.tsx:599)
    in DrawerView (at DrawerView.tsx:235)
    in SafeAreaProviderCompat (at DrawerView.tsx:233)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at DrawerView.tsx:232)
    in DrawerView (at createDrawerNavigator.tsx:47)
    in DrawerNavigator (at drawerNavigator/index.js:12)
    in DrawerNavigator (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:245)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:244)
    in RCTView (at View.js:34)
    in View (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:573)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:549)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
    in RCTView (at View.js:34)
    in View (at Card.tsx:538)
    in Card (at CardContainer.tsx:206)
    in CardContainer (at CardStack.tsx:623)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at Screens.tsx:74)
    in MaybeScreen (at CardStack.tsx:616)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at Screens.tsx:50)
    in MaybeScreenContainer (at CardStack.tsx:498)
    in CardStack (at StackView.tsx:462)
    in KeyboardManager (at StackView.tsx:458)
    in SafeAreaProviderCompat (at StackView.tsx:455)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at StackView.tsx:454)
    in StackView (at createStackNavigator.tsx:87)
    in StackNavigator (at main/index.js:42)
    in StackNavigator (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:245)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:244)
    in RCTView (at View.js:34)
    in View (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:573)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:549)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
    in RCTView (at View.js:34)
    in View (at Card.tsx:538)
    in Card (at CardContainer.tsx:206)
    in CardContainer (at CardStack.tsx:623)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at Screens.tsx:74)
    in MaybeScreen (at CardStack.tsx:616)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at Screens.tsx:50)
    in MaybeScreenContainer (at CardStack.tsx:498)
    in CardStack (at StackView.tsx:462)
    in KeyboardManager (at StackView.tsx:458)
    in SafeAreaProviderCompat (at StackView.tsx:455)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at StackView.tsx:454)
    in StackView (at createStackNavigator.tsx:87)
    in StackNavigator (at appContainer.js:165)
    in AppContainer (at CheckAuth.js:21)
    in CheckAuth (at App.js:143)
    in EnsureSingleNavigator (at BaseNavigationContainer.tsx:411)
    in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
    in ThemeProvider (at NavigationContainer.tsx:90)
    in ForwardRef(NavigationContainer) (at App.js:126)
    in PersistGate (at App.js:125)
    in Provider (at App.js:124)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
    in SafeAreaProvider (at App.js:123)
    in App (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)
[Tue Jun 28 2022 19:15:20.290]  ERROR    TypeError: null is not an object (evaluating 'value[_$$_REQUIRE(_dependencyMap[5], "@realm.io/common").symbols.IS_PROXIED_DICTIONARY]')

This error is located at:
    in HomeScreen (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:245)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:244)
    in RCTView (at View.js:34)
    in View (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:573)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:549)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
    in RCTView (at View.js:34)
    in View (at Card.tsx:538)
    in Card (at CardContainer.tsx:206)
    in CardContainer (at CardStack.tsx:623)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at Screens.tsx:74)
    in MaybeScreen (at CardStack.tsx:616)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at Screens.tsx:50)
    in MaybeScreenContainer (at CardStack.tsx:498)
    in CardStack (at StackView.tsx:462)
    in KeyboardManager (at StackView.tsx:458)
    in SafeAreaProviderCompat (at StackView.tsx:455)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at StackView.tsx:454)
    in StackView (at createStackNavigator.tsx:87)
    in StackNavigator (at homeStack.js:23)
    in HomeStack (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at BottomTabView.tsx:55)
    in SceneContent (at BottomTabView.tsx:172)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at ResourceSavingScene.tsx:30)
    in ResourceSavingScene (at BottomTabView.tsx:166)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at BottomTabView.tsx:146)
    in SafeAreaProviderCompat (at BottomTabView.tsx:145)
    in BottomTabView (at createBottomTabNavigator.tsx:45)
    in BottomTabNavigator (at tabNavigator/index.js:17)
    in TabNavigator (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at ResourceSavingScene.tsx:30)
    in ResourceSavingScene (at DrawerView.tsx:203)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at DrawerView.tsx:182)
    in RCTView (at View.js:34)
    in View (at Drawer.tsx:625)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:444)
    in AnimatedComponent(View) (at createAnimatedComponent.js:455)
    in ForwardRef(AnimatedComponentWrapper) (at Drawer.tsx:618)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:444)
    in AnimatedComponent(View) (at createAnimatedComponent.js:455)
    in ForwardRef(AnimatedComponentWrapper) (at Drawer.tsx:608)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Drawer.tsx:599)
    in DrawerView (at DrawerView.tsx:235)
    in SafeAreaProviderCompat (at DrawerView.tsx:233)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at DrawerView.tsx:232)
    in DrawerView (at createDrawerNavigator.tsx:47)
    in DrawerNavigator (at drawerNavigator/index.js:12)
    in DrawerNavigator (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:245)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:244)
    in RCTView (at View.js:34)
    in View (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:573)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:549)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
    in RCTView (at View.js:34)
    in View (at Card.tsx:538)
    in Card (at CardContainer.tsx:206)
    in CardContainer (at CardStack.tsx:623)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at Screens.tsx:74)
    in MaybeScreen (at CardStack.tsx:616)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at Screens.tsx:50)
    in MaybeScreenContainer (at CardStack.tsx:498)
    in CardStack (at StackView.tsx:462)
    in KeyboardManager (at StackView.tsx:458)
    in SafeAreaProviderCompat (at StackView.tsx:455)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at StackView.tsx:454)
    in StackView (at createStackNavigator.tsx:87)
    in StackNavigator (at main/index.js:42)
    in StackNavigator (at SceneView.tsx:130)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:123)
    in EnsureSingleNavigator (at SceneView.tsx:122)
    in SceneView (at useDescriptors.tsx:181)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:245)
    in RCTView (at View.js:34)
    in View (at CardContainer.tsx:244)
    in RCTView (at View.js:34)
    in View (at CardSheet.tsx:33)
    in ForwardRef(CardSheet) (at Card.tsx:573)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
    in PanGestureHandler (at GestureHandlerNative.tsx:13)
    in PanGestureHandler (at Card.tsx:549)
    in RCTView (at View.js:34)
    in View (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
    in RCTView (at View.js:34)
    in View (at Card.tsx:538)
    in Card (at CardContainer.tsx:206)
    in CardContainer (at CardStack.tsx:623)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at Screens.tsx:74)
    in MaybeScreen (at CardStack.tsx:616)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at Screens.tsx:50)
    in MaybeScreenContainer (at CardStack.tsx:498)
    in CardStack (at StackView.tsx:462)
    in KeyboardManager (at StackView.tsx:458)
    in SafeAreaProviderCompat (at StackView.tsx:455)
    in RCTView (at View.js:34)
    in View (at GestureHandlerRootView.tsx:11)
    in GestureHandlerRootView (at StackView.tsx:454)
    in StackView (at createStackNavigator.tsx:87)
    in StackNavigator (at appContainer.js:165)
    in AppContainer (at CheckAuth.js:21)
    in CheckAuth (at App.js:143)
    in EnsureSingleNavigator (at BaseNavigationContainer.tsx:411)
    in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
    in ThemeProvider (at NavigationContainer.tsx:90)
    in ForwardRef(NavigationContainer) (at App.js:126)
    in PersistGate (at App.js:125)
    in Provider (at App.js:124)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
    in SafeAreaProvider (at App.js:123)
    in App (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)

### Can you reproduce the bug?

Yes, always

### Reproduction Steps

_No response_

### Version

10.19.3

### What SDK flavour are you using?

Local Database only

### Are you using encryption?

No, not using encryption

### Platform OS and version(s)

ios 15.2 

### Build environment

Which debugger for React Native: ..

    "react": "17.0.2",
    "react-native": "0.63.4",

...
"react-redux": "^7.2.6",
"react-statics-styles": "^3.1.0",
"react-tween-state": "^0.1.5",
"react-use": "^17.4.0",
"realm": "^10.19.3",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",


### Cocoapods version
stable 1.11.3 (bottled) from homebrew

@tomduncalf
Copy link
Contributor

Hey @takanorihirai. Sorry to hear you are having issues. Could you please let me know what the following command outputs (run from your project root)?

cat node_modules/@realm.io/common/package.json | grep version

@takanorihirai
Copy link
Author

@tomduncalf , thanks to reply.

% cat node_modules/@realm.io/common/package.json | grep version
  "version": "0.1.4",
%

the latest one.
https://www.npmjs.com/package/@realm.io/common

@takanorihirai
Copy link
Author

i'm avoiding error and crash with patch as a makeshift :

@@ -106,10 +106,16 @@ module.exports = function (realmConstruc
           // skip any functions & constructors (in case of class models).
           if (typeof value === "function") {
             return; // continue
           }
 
+          // XXX https://github.com/realm/realm-js/issues/4682
+          if ( value === null ){
+            result[key] = value;
+            return; // continue
+          }
+
           // recursively trigger `toJSON` for Realm instances with the same cache.
           if (value instanceof realmConstructor.Object || value instanceof realmConstructor.Collection) {
             result[key] = value.toJSON(key, cache);
           } else if (
             value instanceof realmConstructor.Dictionary ||

@tomduncalf
Copy link
Contributor

Thanks @takanorihirai! I've created a PR with the fix, which we will get into a release soon

tomduncalf pushed a commit that referenced this issue Jun 29, 2022
* Fix null handling in toJSON (fixes #4682)

* Changelog

* Fix lint
takameyer pushed a commit that referenced this issue Jun 30, 2022
* Fix null handling in toJSON (fixes #4682)

* Changelog

* Fix lint
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants