File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,13 @@ class Model {
4646 }
4747
4848 if (entity.flags != 0 ) {
49- _check (bindings.obx_model_entity_flags (_cModel, entity.flags));
49+ // TODO remove try-catch after upgrading to objectbox-c v0.11 where obx_model_entity_flags() exists.
50+ try {
51+ _check (bindings.obx_model_entity_flags (_cModel, entity.flags));
52+ } on ArgumentError {
53+ // flags not supported; don't do anything until objectbox-c v0.11
54+ // this should only be used from our test code
55+ }
5056 }
5157
5258 // add all properties
Original file line number Diff line number Diff line change @@ -220,9 +220,17 @@ class Sync {
220220 /// Sync() annotation enables synchronization for an entity.
221221 const Sync ();
222222
223+ static bool _syncAvailable;
224+
223225 /// Returns true if the loaded ObjectBox native library supports Sync.
224226 static bool isAvailable () {
225- return bindings.obx_sync_available () != 0 ;
227+ // TODO remove try-catch after upgrading to objectbox-c v0.11 where obx_sync_available() exists.
228+ try {
229+ _syncAvailable ?? = bindings.obx_sync_available () != 0 ;
230+ } on ArgumentError {
231+ _syncAvailable = false ;
232+ }
233+ return _syncAvailable;
226234 }
227235
228236 /// Creates a sync client associated with the given store and configures it with the given options.
You can’t perform that action at this time.
0 commit comments