Browse Source

NullSafety: Migrate DeduplicateFiles model

Neeraj Gupta 2 years ago
parent
commit
c44faad771
1 changed files with 3 additions and 4 deletions
  1. 3 4
      lib/models/duplicate_files.dart

+ 3 - 4
lib/models/duplicate_files.dart

@@ -1,5 +1,3 @@
-// @dart=2.9
-
 import 'dart:convert';
 import 'dart:convert';
 
 
 import 'package:photos/models/file.dart';
 import 'package:photos/models/file.dart';
@@ -58,9 +56,10 @@ class DuplicateFiles {
   sortByCollectionName() {
   sortByCollectionName() {
     files.sort((first, second) {
     files.sort((first, second) {
       final firstName =
       final firstName =
-          collectionsService.getCollectionByID(first.collectionID).name;
+          collectionsService.getCollectionByID(first.collectionID!)!.name ?? '';
       final secondName =
       final secondName =
-          collectionsService.getCollectionByID(second.collectionID).name;
+          collectionsService.getCollectionByID(second.collectionID!)!.name ??
+              '';
       return firstName.compareTo(secondName);
       return firstName.compareTo(secondName);
     });
     });
   }
   }