fix(calendar(core)): avoid generating empty parameters list

pull/270/head
Ludovic Marcotte 2020-02-27 15:26:39 -05:00
parent 78292495bb
commit 62e25f6c13
1 changed files with 6 additions and 6 deletions

View File

@ -1,8 +1,6 @@
/* CardVersitRenderer.m - this file is part of SOPE /* CardVersitRenderer.m - this file is part of SOPE
* *
* Copyright (C) 2006-2012 Inverse inc. * Copyright (C) 2006-2020 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -49,7 +47,7 @@
- (NSString *) renderElement: (CardElement *) anElement - (NSString *) renderElement: (CardElement *) anElement
{ {
NSMutableString *rendering; NSMutableString *rendering, *buffer;
NSDictionary *attributes; NSDictionary *attributes;
NSMutableDictionary *values; NSMutableDictionary *values;
NSString *finalRendering, *tag; NSString *finalRendering, *tag;
@ -73,10 +71,12 @@
attributes = [anElement attributes]; attributes = [anElement attributes];
if ([attributes count]) if ([attributes count])
{ {
[rendering appendString: @";"]; buffer = [NSMutableString string];
[attributes versitRenderInString: rendering [attributes versitRenderInString: buffer
withKeyOrdering: [anElement orderOfAttributeKeys] withKeyOrdering: [anElement orderOfAttributeKeys]
asAttributes: YES]; asAttributes: YES];
if ([buffer length])
[rendering appendFormat: @";%@", buffer];
} }
/* values */ /* values */