Fix potential unknown selector exception

This commit is contained in:
Sebastián Katzer 2019-03-01 17:48:52 +01:00
parent 9362e4c341
commit 9cbb6b8f9a

View File

@ -58,10 +58,11 @@
withSettings:(NSDictionary *)settings withSettings:(NSDictionary *)settings
{ {
id layout = [[self alloc] initWithDictionary:settings]; id layout = [[self alloc] initWithDictionary:settings];
SEL setFont = NSSelectorFromString(@"font");
[layout configureFormatter:formatter]; [layout configureFormatter:formatter];
if (settings && ![formatter isKindOfClass:UIMarkupTextPrintFormatter.class]) if (settings && [formatter respondsToSelector:setFont])
{ {
[layout configureTextFormatter:(UISimpleTextPrintFormatter *)formatter [layout configureTextFormatter:(UISimpleTextPrintFormatter *)formatter
withSettings:settings]; withSettings:settings];