am 1fba5d21: Merge "Fix crash when deleting voicemail." into mnc-dev
* commit '1fba5d21e59faf3cb68dae7492bbfd57b3c0f9a3':
Fix crash when deleting voicemail.
diff --git a/src/com/android/phone/vvm/omtp/fetch/VoicemailFetchedCallback.java b/src/com/android/phone/vvm/omtp/fetch/VoicemailFetchedCallback.java
index bf5befd..eb6a175 100644
--- a/src/com/android/phone/vvm/omtp/fetch/VoicemailFetchedCallback.java
+++ b/src/com/android/phone/vvm/omtp/fetch/VoicemailFetchedCallback.java
@@ -61,7 +61,8 @@
outputStream.write(inputBytes);
}
} catch (IOException e) {
- Log.e(TAG, "Error writing to file: ", e);
+ Log.w(TAG, String.format("File not found for %s", mUri));
+ return;
} finally {
IoUtils.closeQuietly(outputStream);
}
diff --git a/src/com/android/phone/vvm/omtp/imap/ImapHelper.java b/src/com/android/phone/vvm/omtp/imap/ImapHelper.java
index 1d20dbd..d68a36b 100644
--- a/src/com/android/phone/vvm/omtp/imap/ImapHelper.java
+++ b/src/com/android/phone/vvm/omtp/imap/ImapHelper.java
@@ -194,6 +194,11 @@
}
message = mFolder.getMessage(uid);
VoicemailPayload voicemailPayload = fetchVoicemailPayload(message);
+
+ if (voicemailPayload == null) {
+ return false;
+ }
+
callback.setVoicemailContent(voicemailPayload);
return true;
} catch (MessagingException e) {