Skip to content

Commit

Permalink
Check for color attribute to fix errors on macoOS Catalina (10.15)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbraber committed Oct 13, 2019
1 parent 132f278 commit 1d7fea8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions icalBuddyPrettyPrint.m
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ @implementation PropertyPresentationElements
if ([propName isEqualToString:kPropName_title]
&& prettyPrintOptions.useCalendarColorsForTitles
&& ![[[elements.value attributesAtIndex:0 effectiveRange:NULL] allKeys] containsObject:NSForegroundColorAttributeName]
&& [[event calendar] color] != nil
)
[elements.value
addAttribute:NSForegroundColorAttributeName
Expand Down Expand Up @@ -1112,16 +1113,15 @@ void printAllCalendars(AppOptions *opts)
{
ADD_TO_OUTPUT_BUFFER(ATTR_STR(@""));
NSMutableAttributedString *calendarName = M_ATTR_STR([cal title]);
[calendarName addAttribute:NSForegroundColorAttributeName value:[cal color] range:NSMakeRange(0, [calendarName length])];
if([cal color] != nil)
[calendarName addAttribute:NSForegroundColorAttributeName value:[cal color] range:NSMakeRange(0, [calendarName length])];
ADD_TO_OUTPUT_BUFFER(calendarName);
ADD_TO_OUTPUT_BUFFER(ATTR_STR(@"\n"));
ADD_TO_OUTPUT_BUFFER(ATTR_STR(([NSString stringWithFormat:@" type: %@\n", [cal type]])));
ADD_TO_OUTPUT_BUFFER(ATTR_STR(([NSString stringWithFormat:@" UID: %@\n", [cal uid]])));
}
}



void flushOutputBuffer(NSMutableAttributedString *buffer, AppOptions *opts, NSDictionary *formattedKeywords)
{
if (opts->useFormatting
Expand Down

0 comments on commit 1d7fea8

Please sign in to comment.