-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Description
Describe the bug
When attempting to create a nested embedded object in an embedded object list in Realm Studio, the following error is displayed:
Couldn't create the City:
Cannot read properties of null (reading 'push')
To Reproduce
Steps to reproduce the behavior:
- Define the schemas as shown below:
class City extends Realm.Object<City> {
static schema: Realm.ObjectSchema = {
name: 'City',
embedded: true,
properties: {
name: 'string',
},
};
name!: string;
}
class Address extends Realm.Object<Address> {
static schema: Realm.ObjectSchema = {
name: 'Address',
embedded: true,
properties: {
street: 'string',
city: 'City',
},
};
street!: string;
city!: City;
}
class Person extends Realm.Object<Person> {
static schema: Realm.ObjectSchema = {
name: 'Person',
primaryKey: '_id',
properties: {
_id: 'objectId',
name: 'string',
addresses: 'Address[]',
},
};
_id!: Realm.BSON.ObjectId;
name!: string;
addresses!: Realm.List<Address>;
}- Attempt to create a City object within an Address object.
- See error.
Expected behavior
The City object should be created without errors.
Versions:
- OS: Windows 11 Version 23H2 (OS Build 22631.4037)
- Studio Version 15.2.1
Additional context
This issue does not occur when creating the same objects using the Node.js SDK.
