File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
objectbox/lib/src/native/bindings Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,17 @@ ObjectBoxC? _tryObjectBoxLibProcess() {
1919 // [DynamicLibrary.process()] is not supported on windows, see its docs.
2020 if (Platform .isWindows) return null ;
2121
22- ObjectBoxC ? obxc;
2322 try {
24- _lib = DynamicLibrary .process ();
25- obxc = ObjectBoxC (_lib! );
26- _isSupportedVersion (obxc); // may throw in case symbols are not found
27- return obxc;
23+ final lib = DynamicLibrary .process ();
24+ // Check if the library is actually loaded by searching for a common function.
25+ // Note: not using 'lookup' as its exception if not found is caught if
26+ // All Exceptions is enabled in VS Code.
27+ if (lib.providesSymbol ('obx_version_is_at_least' )) {
28+ _lib = lib;
29+ return ObjectBoxC (lib);
30+ } else {
31+ return null ;
32+ }
2833 } catch (_) {
2934 // ignore errors (i.e. symbol not found)
3035 return null ;
You can’t perform that action at this time.
0 commit comments