[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - android/app

mert (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 10 11:46:09 UTC 2020


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

New commits:
commit 0ccfa0ecc98b38fef59ce733842844246e54c77e
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 13:45:51 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>
    (cherry picked from commit 93bf06a2078ade47db7c8a45ba448c3cc66aa96c)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92011

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