Fix crash when deleting voicemail.

Catch "file not found" exception gracefully and exit. Make null check
before calling VoicemailFetchedCallback

Bug: 22538959
Change-Id: Ic8a58be17da61f9b5337a2e5c89631c499473ca3
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) {