diff options
author | Sam Bingner <sam@bingner.com> | 2021-08-20 17:40:39 -1000 |
---|---|---|
committer | Sam Bingner <sam@bingner.com> | 2024-01-08 09:31:43 -1000 |
commit | adc80ad06be636c6fa26606f81c4c5303afde0d5 (patch) | |
tree | 41d384bbe1a412da6d91583c4b0d1b3a8ae0cce3 | |
parent | 83c7e3e3aca12ef3ec95e42af7442adc584b21c9 (diff) |
[sbreload] Let's not crash if the job has no PIDv1.1.21
-rw-r--r-- | sbreload.m | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -254,7 +254,7 @@ pid_t launch_get_job_pid(const char * job) if (launch_data_get_type(resp) != LAUNCH_DATA_DICTIONARY) return -1; launch_data_t pid_data = launch_data_dict_lookup(resp, "PID"); - if (launch_data_get_type(pid_data) != LAUNCH_DATA_INTEGER) return -1; + if (pid_data == NULL || launch_data_get_type(pid_data) != LAUNCH_DATA_INTEGER) return -1; pid_t pid = (pid_t)launch_data_get_integer(pid_data); launch_data_free(resp); |