[Libreoffice-commits] online.git: android/app

mert (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 10 10:59:28 UTC 2020


 android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 93bf06a2078ade47db7c8a45ba448c3cc66aa96c
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Fri Apr 10 12:39:35 2020 +0300
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Fri Apr 10 12:59:11 2020 +0200

    android: Blind fix for an exception of getContentResolver
    
    Change-Id: Iec24f014a2c82b8f4d4c134b9817651f558ecedb
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92005
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java
index 380b4a64f..cf69e690e 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java
@@ -76,6 +76,8 @@ class RecentFilesAdapter extends RecyclerView.Adapter<RecentFilesAdapter.ViewHol
             cursor = activity.getContentResolver().query(uri, null, null, null, null);
             if (cursor != null && cursor.moveToFirst())
                 filename = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
+        } catch (Exception e) {
+            return null;
         } finally {
             if (cursor != null)
                 cursor.close();
@@ -95,6 +97,8 @@ class RecentFilesAdapter extends RecyclerView.Adapter<RecentFilesAdapter.ViewHol
             cursor = activity.getContentResolver().query(uri, null, null, null, null);
             if (cursor != null && cursor.moveToFirst())
                 length = cursor.getLong(cursor.getColumnIndex(OpenableColumns.SIZE));
+        } catch (Exception e) {
+            return 0;
         } finally {
             if (cursor != null)
                 cursor.close();


More information about the Libreoffice-commits mailing list