From 629b23027f567dda314d97c919b96ea3eb37ef95 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 16 Dec 2010 02:52:20 +0000 Subject: [PATCH] Provisional fix for Issue 2760 in k9mail: New NPE from market. showing up a lot on 3.400 --- src/com/fsck/k9/provider/AttachmentProvider.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/fsck/k9/provider/AttachmentProvider.java b/src/com/fsck/k9/provider/AttachmentProvider.java index 13e6cbf23..4e28d85ed 100644 --- a/src/com/fsck/k9/provider/AttachmentProvider.java +++ b/src/com/fsck/k9/provider/AttachmentProvider.java @@ -242,6 +242,13 @@ public class AttachmentProvider extends ContentProvider List segments = uri.getPathSegments(); String dbName = segments.get(0); String id = segments.get(1); + + // Versions of K-9 before 3.400 had a database name here, not an + // account UID, so implement a bit of backcompat + if (dbName.endsWith(".db")) { + dbName = dbName.substring(0, dbName.length()-3); + } + //String format = segments.get(2); final AttachmentInfo attachmentInfo; try