Prevent crash

This commit is contained in:
M66B 2019-07-05 20:28:41 +02:00
parent 178c885183
commit f906271b0c
1 changed files with 20 additions and 13 deletions

View File

@ -659,20 +659,27 @@ public class FragmentCompose extends FragmentBase {
if (savedInstanceState == null) { if (savedInstanceState == null) {
if (working < 0) { if (working < 0) {
Bundle a = getArguments();
if (a == null) {
a = new Bundle();
a.putString("action", "new");
}
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("action", getArguments().getString("action"));
args.putLong("id", getArguments().getLong("id", -1)); args.putString("action", a.getString("action"));
args.putLong("account", getArguments().getLong("account", -1)); args.putLong("id", a.getLong("id", -1));
args.putLong("reference", getArguments().getLong("reference", -1)); args.putLong("account", a.getLong("account", -1));
args.putSerializable("ics", getArguments().getSerializable("ics")); args.putLong("reference", a.getLong("reference", -1));
args.putBoolean("raw", getArguments().getBoolean("raw", false)); args.putSerializable("ics", a.getSerializable("ics"));
args.putLong("answer", getArguments().getLong("answer", -1)); args.putBoolean("raw", a.getBoolean("raw", false));
args.putString("to", getArguments().getString("to")); args.putLong("answer", a.getLong("answer", -1));
args.putString("cc", getArguments().getString("cc")); args.putString("to", a.getString("to"));
args.putString("bcc", getArguments().getString("bcc")); args.putString("cc", a.getString("cc"));
args.putString("subject", getArguments().getString("subject")); args.putString("bcc", a.getString("bcc"));
args.putString("body", getArguments().getString("body")); args.putString("subject", a.getString("subject"));
args.putParcelableArrayList("attachments", getArguments().getParcelableArrayList("attachments")); args.putString("body", a.getString("body"));
args.putParcelableArrayList("attachments", a.getParcelableArrayList("attachments"));
draftLoader.execute(this, args, "compose:new"); draftLoader.execute(this, args, "compose:new");
} else { } else {
Bundle args = new Bundle(); Bundle args = new Bundle();