I’ve found the reason. Here’s my structure:
open class Quiz: RealmObject {
...
var _id: ObjectId = ObjectId()
var questions: RealmList<QuizQuestion> = realmListOf()
}
open class QuizQuestion: EmbeddedRealmObject {
...
var codeExample: CodeExample = CodeExample()
}
open class CodeExample: EmbeddedRealmObject {
...
}
To fix the issue, I had to add codeExample as nullable type, with a null as a default value. Then the error disappeared. Hope it helps someone. ![]()
open class QuizQuestion: EmbeddedRealmObject {
...
var codeExample: CodeExample? = null
}