Add a missing null pointer check.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/593183003/
This commit is contained in:
Erik Chen 2014-09-23 14:54:41 -04:00 committed by Mark Mentovai
parent fec869992f
commit 7e5c11f59a

View File

@ -129,6 +129,10 @@ pid_t ServiceManagementIsJobRunning(const std::string& label) {
}
launch_data_t pid = launch_data_dict_lookup(dictionary, LAUNCH_JOBKEY_PID);
if (!pid) {
return 0;
}
if (launch_data_get_type(pid) != LAUNCH_DATA_INTEGER) {
return 0;
}