Преглед на файлове

Handle case where in the search results could not be fetched

Vishnu Mohandas преди 5 години
родител
ревизия
e96f5f0a1f
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      lib/face_search_manager.dart

+ 3 - 0
lib/face_search_manager.dart

@@ -48,6 +48,9 @@ class FaceSearchManager {
           .toList();
     }).catchError(_onError);
     final files = List<File>();
+    if (result == null) {
+      return throw ("Oops. Could not fetch search results.");
+    }
     for (File file in result) {
       try {
         files.add(await FileDB.instance.getMatchingFile(