Skip to content

Commit

Permalink
Fix for NPE with audio attachments.
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie0 committed Feb 26, 2014
1 parent 82df23d commit dec7fd4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/org/thoughtcrime/securesms/mms/AudioSlide.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ public static PduPart constructPartFromUri(Context context, Uri uri) throws IOEx
cursor = context.getContentResolver().query(uri, new String[]{Audio.Media.MIME_TYPE}, null, null, null);

if (cursor != null && cursor.moveToFirst())
part.setContentType(cursor.getString(0).getBytes());
part.setContentType(cursor.getString(0).getBytes());
else
throw new IOException("Unable to query content type.");
throw new IOException("Unable to query content type.");
} finally {
cursor.close();
if (cursor != null)
cursor.close();
}

part.setDataUri(uri);
Expand Down

0 comments on commit dec7fd4

Please sign in to comment.