mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-10 05:44:16 +00:00
check if localized UTF8String is null
This commit is contained in:
parent
bb1c23a668
commit
f5ab515260
1 changed files with 4 additions and 1 deletions
|
@ -160,7 +160,10 @@ CGImageRef workspace_icon_for_app(char* app) {
|
|||
char* name = NULL;
|
||||
if (notification && notification.userInfo) {
|
||||
NSRunningApplication* app = [notification.userInfo objectForKey:NSWorkspaceApplicationKey];
|
||||
if (app) name = string_copy((char*)[[app localizedName] UTF8String]);
|
||||
if (app) {
|
||||
char* app_name_tmp = (char*)[[app localizedName] UTF8String];
|
||||
if (app_name_tmp) name = string_copy(app_name_tmp);
|
||||
}
|
||||
}
|
||||
struct event event = { name, APPLICATION_FRONT_SWITCHED };
|
||||
event_post(&event);
|
||||
|
|
Loading…
Reference in a new issue