Repository: thundernest/k-9
Issue: Crash in 5.205: Bug in ParcelableUtil.unmarshall()?

Crash reported via Google Play.

User messages:
* crash when opening from 1x1 widget
* using inbox icon to start k9 results in crash
* force closes on start from widget


```
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fsck.k9/com.fsck.k9.activity.MessageList}: java.lang.NullPointerException: Attempt to get length of null array
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
	at android.app.ActivityThread.access$1100(ActivityThread.java:221)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:158)
	at android.app.ActivityThread.main(ActivityThread.java:7224)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to get length of null array
	at com.fsck.k9.helper.ParcelableUtil.unmarshall(ParcelableUtil.java:27)
	at com.fsck.k9.helper.ParcelableUtil.unmarshall(ParcelableUtil.java:19)
	at com.fsck.k9.activity.MessageList.decodeExtras(MessageList.java:437)
	at com.fsck.k9.activity.MessageList.onCreate(MessageList.java:225)
	at android.app.Activity.performCreate(Activity.java:6876)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
	... 9 more
```

Changed files:
k9mail/src/main/java/com/fsck/k9/activity/MessageList.java

diff --git a/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java b/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
index f1addf57f..28f4c0df3 100644
--- a/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
+++ b/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java
@@ -72,8 +72,11 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
         MessageViewFragmentListener, OnBackStackChangedListener, OnSwipeGestureListener,
         OnSwitchCompleteListener {
 
-    // for this activity
-    private static final String EXTRA_SEARCH = "search";
+    @Deprecated
+    //TODO: Remove after 2017-09-11
+    private static final String EXTRA_SEARCH_OLD = "search";
+
+    private static final String EXTRA_SEARCH = "search_bytes";
     private static final String EXTRA_NO_THREADING = "no_threading";
 
     private static final String ACTION_SHORTCUT = "shortcut";
@@ -431,6 +434,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
                     mSearch.addAccountUuid(LocalSearch.ALL_ACCOUNTS);
                 }
             }
+        } else if (intent.hasExtra(EXTRA_SEARCH_OLD)) {
+            mSearch = intent.getParcelableExtra(EXTRA_SEARCH_OLD);
+            mNoThreading = intent.getBooleanExtra(EXTRA_NO_THREADING, false);
         } else {
             // regular LocalSearch object was passed
             mSearch = intent.hasExtra(EXTRA_SEARCH) ?