From b523380c663ae9f5d5a9c17ce0b1d0ef21b06e22 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Mon, 19 Jun 2017 19:53:00 +0200 Subject: MacGui: do not crash if hb_video_encoder_get_name returns NULL, it might happens if there is a saved job with an external encoder (x264 10bit for example), and the external lib is no longer available. --- macosx/HBJob+UIAdditions.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/macosx/HBJob+UIAdditions.m b/macosx/HBJob+UIAdditions.m index 569f1249d..a3a3322cf 100644 --- a/macosx/HBJob+UIAdditions.m +++ b/macosx/HBJob+UIAdditions.m @@ -361,7 +361,7 @@ static NSDictionary *shortHeightAttr; [attrString appendString:summary withAttributes:detailAttr]; [attrString appendString:@"\n" withAttributes:detailAttr]; } - + return attrString; } @@ -370,7 +370,8 @@ static NSDictionary *shortHeightAttr; NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] init]; NSMutableString *videoInfo = [NSMutableString string]; - [videoInfo appendFormat:@"Encoder: %@, ", @(hb_video_encoder_get_name(self.video.encoder))]; + const char *encoderName = hb_video_encoder_get_name(self.video.encoder); + [videoInfo appendFormat:@"Encoder: %@, ", encoderName ? @(encoderName) : @"Unknown"]; [videoInfo appendString:@"Framerate: "]; -- cgit v1.2.3