mentrena / SyncKit

Automatic CloudKit synchronization
https://mentrena.github.io/SyncKit/
MIT License
507 stars 59 forks source link

Unexpectedly found nil while unwrapping an Optional value #157

Closed torfluor closed 2 years ago

torfluor commented 3 years ago

In RealmSwiftAdapter.swift on line 845 the object is unwrapped with !, witch cause my app to crash whenever it's started. The only workaround is to delete and reinstall the app. The app is not live yet, so I don't know if this error will occur in normal use, but it would be nice to have a better handling of errors like this.

Complete error message: Fatal error: Unexpectedly found nil while unwrapping an Optional value: file SyncKit_RealmSwift/RealmSwiftAdapter.swift, line 845 2021-06-07 10:59:26.337698+0200 Timeline Pro[1794:1128007] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file SyncKit_RealmSwift/RealmSwiftAdapter.swift, line 845

mentrena commented 2 years ago

This was probably what got fixed here: https://github.com/mentrena/SyncKit/pull/165/commits/e35b2a542ad87df0ba0ce0c86be2eaeebe2bfa64 I'll close but let me know if it happens again!