From aaa64b879e3e54ece97e9babdd7e13127974a449 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 7 Dec 2015 00:49:36 +0100 Subject: cocoa: fix recent regression Commit 9db50c67 changed it so that the window title can now be a NULL string. Completely untested. Probably fixes #2570. --- video/out/cocoa_common.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'video') 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; -- cgit v1.2.3