浏览代码

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(