IDE: Fire
Version: _9.0.97.2071, 9.1.100.2076
Target: Java
Description:
Not sure how much this is helpful for you guys to debug, but try? still often results in cunning compile time error: object reference is not set to the instance of object.
I couldn’t yet find pattern but the example would be calling this method:
try? report.deleteLocally()
where delete locally is defined as
/// doesn't remove the _persistentEntity from this report object. Only deletes it.
/// after calling, you should not be accessing any accessors of deleted Report except 'hasBeenDeletedLocally'
/// calling the other accessors will lead to underfined behaviour.
public func deleteLocally() throws {
try RealmGate.write { (realm: Realm) in
#if COOPER
(self.persistentEntity as RealmObject).deleteFromRealm()
#else
realm.delete(self.persistentEntity)
#endif
}
self.hasBeenDeletedLocally = true
}
where RealmGate.write is defined as:
public static func write(_ closure: @escaping (Realm) -> Void) throws {
let realm = try self.defaultRealm()
try realm.write {
closure(realm)
}
}
which is defined in java class(RealmGate) extension.
where realm.write is defined in Realm android library respectfully.
Unfortunately cannot provide the project for this thing, since it is not open-source. Hope it helps