diff --git a/src/app-manager.c b/src/app-manager.c index 5092e00..ac5c84b 100644 --- a/src/app-manager.c +++ b/src/app-manager.c @@ -97,12 +97,20 @@ static GPid app_get_pid(WnckApplication *application) { GPid pid; + GList *windows; + if (NULL == application) return (0); pid = wnck_application_get_pid (application); if (pid != 0) return (pid); - return (wnck_window_get_pid (WNCK_WINDOW (wnck_application_get_windows (application)->data))); + + windows = wnck_application_get_windows (application); + + if (NULL == windows) + return (0); + + return (wnck_window_get_pid (windows->data)); } static gint