From a2ef542ad4251d32444aa3ad3930ccbd12e8ee65 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 25 May 2021 11:56:36 -0400 Subject: [PATCH] fix(mail): avoid exception on recent GNUstep when no filename is defined --- UI/MailPartViewers/UIxMailPartViewer.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/UI/MailPartViewers/UIxMailPartViewer.m b/UI/MailPartViewers/UIxMailPartViewer.m index bb411e582..ab092394b 100644 --- a/UI/MailPartViewers/UIxMailPartViewer.m +++ b/UI/MailPartViewers/UIxMailPartViewer.m @@ -266,15 +266,14 @@ NSMutableString *filename; NSString *extension; - filename = [NSMutableString stringWithString: [self filename]]; - if ([filename length]) + if ([[self filename] length]) // We replace any slash by a dash since Apache won't allow encoded slashes by default. // See http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes - filename = [NSMutableString stringWithString: [filename stringByReplacingString: @"/" withString: @"-"]]; + filename = [NSMutableString stringWithString: [[self filename] stringByReplacingString: @"/" withString: @"-"]]; else - [filename appendFormat: @"%@-%@", - [self labelForKey: @"Untitled"], - [bodyPart nameInContainer]]; + filename = [NSMutableString stringWithFormat: @"%@-%@", + [self labelForKey: @"Untitled"], + [bodyPart nameInContainer]]; if (![[filename pathExtension] length]) {