Hi,
I bumped on a new issue today, while trying to write data to a Collection.
I’m working on an Android Project with Kotlin and Realm Sync since a few months, and the testing has been quite extensive on all the projects features.
I’m pretty sure this wasn’t happening a few months ago, wondering if it’s a new thing.
So the scenario is:
- WorkOrder collection: items contain an optional reference to Asset collection
var productData: Asset? = Asset(),
- Asset collection: it’s an embedded collection (@RealmClass(embedded = true)) with a reference to another embedded collection
var installedFirmware: InstalledFirmware? = InstalledFirmware()
When I try to write a new Asset on a WorkOrder, it throws an exception:
java.lang.IllegalStateException: Wrong kind of table
Exception backtrace:
backtrace not supported on this platform
I found out that if I change:
-
var installedFirmware: InstalledFirmware? = InstalledFirmware()
to
-
var installedFirmware: InstalledFirmware? = null
everything works just fine.
I tested the same in other objects as well.
What’s the logic behind this?
I can easily change to have null in those cases, but I’d like to understand why that’s needed.
Thanks,
Alessandro