Fix an NPE
Bug 10434691
Change-Id: I361b7452d481cbe5c7db342b7d8c106a5ed4d331
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 5097684..5b31253 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -2451,6 +2451,13 @@
* @return boolean
*/
public boolean isBlank() {
+ // Need to check for null since isBlank() can be called from onPause()
+ // before findViews() is called
+ if (mSubject == null || mBodyView == null || mTo == null || mCc == null ||
+ mAttachmentsView == null) {
+ LogUtils.w(LOG_TAG, "null views in isBlank check");
+ return true;
+ }
return mSubject.getText().length() == 0
&& (mBodyView.getText().length() == 0 || getSignatureStartPosition(mSignature,
mBodyView.getText().toString()) == 0)