0012156: clicking on forwarded .eml fails
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 2 Sep 2016 08:49:19 +0000 (10:49 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 2 Sep 2016 11:20:10 +0000 (13:20 +0200)
https://forge.tine20.org/view.php?id=12156

Change-Id: I8d1de866a4ec542fa481b925f48f8afda09a86e5
Reviewed-on: http://gerrit.tine20.com/customers/3511
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/js/Model.js

index 16f3c89..07cd03f 100644 (file)
@@ -229,9 +229,14 @@ Tine.Felamimail.messageBackend = new Tine.Tinebase.data.RecordProxy({
 
         if (mimeType == 'configured') {
             var account = Tine.Tinebase.appMgr.get('Felamimail').getAccountStore().getById(message.get('account_id'));
-            mimeType = account.get('display_format');
-            if (! mimeType.match(/^text\//)) {
-                mimeType = 'text/' + mimeType;
+            if (account) {
+                mimeType = account.get('display_format');
+                if (!mimeType.match(/^text\//)) {
+                    mimeType = 'text/' + mimeType;
+                }
+            } else {
+                // no account found, might happen for .eml emails
+                mimeType = 'text/plain';
             }
         }