Skip to content

Commit

Permalink
fix(mail): handle case where the msg is of content type application
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Jan 7, 2022
1 parent 66bac18 commit 81c1997
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions UI/MailPartViewers/UIxMailPartViewer.m
@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2017 Inverse inc.
Copyright (C) 2007-2022 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo.
Expand All @@ -21,6 +21,7 @@
*/

#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>

#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
Expand Down Expand Up @@ -168,11 +169,20 @@ - (SOGoMailBodyPart *) clientPart
NSEnumerator *parts;

currentObject = [self clientObject];
parts = [partPath objectEnumerator];
while ((currentPart = [parts nextObject]))
currentObject = [currentObject lookupName: currentPart
inContext: context
acquire: NO];
if (partPath)
{
parts = [partPath objectEnumerator];
while ((currentPart = [parts nextObject]))
currentObject = [currentObject lookupName: currentPart
inContext: context
acquire: NO];
}
else
{
[self warnWithFormat: @"No path specified, returning first part"];
currentObject = [[self clientObject] lookupImap4BodyPartKey: @"0"
inContext: context];
}

return currentObject;
}
Expand Down

0 comments on commit 81c1997

Please sign in to comment.