diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index ab2f666c3e..2cb365cc1f 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -515,10 +515,12 @@ static int cocoa_set_window_title(struct vo *vo) void *talloc_ctx = talloc_new(NULL); struct bstr btitle = bstr_sanitize_utf8_latin1(talloc_ctx, bstr0(s->window_title)); - NSString *nstitle = [NSString stringWithUTF8String:btitle.start]; - if (nstitle) { - [s->window setTitle: nstitle]; - [s->window displayIfNeeded]; + if (btitle.start) { + NSString *nstitle = [NSString stringWithUTF8String:btitle.start]; + if (nstitle) { + [s->window setTitle: nstitle]; + [s->window displayIfNeeded]; + } } talloc_free(talloc_ctx); return VO_TRUE;