cocoa: fix recent regression

Commit 9db50c67 changed it so that the window title can now be a NULL
string.

Completely untested. Probably fixes #2570.
This commit is contained in:
wm4 2015-12-07 00:49:36 +01:00
parent 159eb3f962
commit aaa64b879e
1 changed files with 6 additions and 4 deletions

View File

@ -515,11 +515,13 @@ 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));
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;
}