Commit 6ad86ce 1 parent 80ffa2c commit 6ad86ce Copy full SHA for 6ad86ce
File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -794,22 +794,23 @@ void convertOnlineIDs<T>() where T : RealmObject
794
794
break ;
795
795
796
796
case 21 :
797
- try
798
- {
799
- // Migrate collections from external file to inside realm.
800
- // We use the "legacy" importer because that is how things were actually being saved out until now.
801
- var legacyCollectionImporter = new LegacyCollectionImporter ( this ) ;
797
+ // Migrate collections from external file to inside realm.
798
+ // We use the "legacy" importer because that is how things were actually being saved out until now.
799
+ var legacyCollectionImporter = new LegacyCollectionImporter ( this ) ;
802
800
803
- if ( legacyCollectionImporter . GetAvailableCount ( storage ) . GetResultSafely ( ) > 0 )
801
+ if ( legacyCollectionImporter . GetAvailableCount ( storage ) . GetResultSafely ( ) > 0 )
802
+ {
803
+ legacyCollectionImporter . ImportFromStorage ( storage ) . ContinueWith ( task =>
804
804
{
805
- legacyCollectionImporter . ImportFromStorage ( storage ) . WaitSafely ( ) ;
805
+ if ( task . Exception != null )
806
+ {
807
+ // can be removed 20221027 (just for initial safety).
808
+ Logger . Error ( task . Exception . InnerException , "Collections could not be migrated to realm. Please provide your \" collection.db\" to the dev team." ) ;
809
+ return ;
810
+ }
811
+
806
812
storage . Move ( "collection.db" , "collection.db.migrated" ) ;
807
- }
808
- }
809
- catch ( Exception e )
810
- {
811
- // can be removed 20221027 (just for initial safety).
812
- Logger . Error ( e , "Collections could not be migrated to realm. Please provide your \" collection.db\" to the dev team." ) ;
813
+ } ) ;
813
814
}
814
815
815
816
break ;
You can’t perform that action at this time.
0 commit comments