From fb97f9d18f4a4152983ffbbfa2bae5881f3f22ce Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 4 Jan 2016 20:14:08 +0100 Subject: null check in getOriginalPath --- src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 1 - src/main/java/eu/siacs/conversations/utils/FileUtils.java | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index b18a2844..5366fdee 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -152,7 +152,6 @@ public class FileBackend { } public String getOriginalPath(Uri uri) { - Log.d(Config.LOGTAG,"get original path for uri: "+uri.toString()); return FileUtils.getPath(mXmppConnectionService,uri); } diff --git a/src/main/java/eu/siacs/conversations/utils/FileUtils.java b/src/main/java/eu/siacs/conversations/utils/FileUtils.java index c2984111..ad8b8640 100644 --- a/src/main/java/eu/siacs/conversations/utils/FileUtils.java +++ b/src/main/java/eu/siacs/conversations/utils/FileUtils.java @@ -23,6 +23,9 @@ public class FileUtils { */ @SuppressLint("NewApi") public static String getPath(final Context context, final Uri uri) { + if (uri == null) { + return null; + } final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; -- cgit v1.2.3