Check for none in innerheaders

This was causing a bug, among other things, when saving to the Sent
folder for some messages. Closes #4914
Merge remote-tracking branch 'refs/remotes/kali/bug/nonecheck-for-innerheaders' into develop