diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2014-10-22 11:46:52 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2014-10-22 11:46:52 +0100 |
commit | e207c67d436afc461c5385bb577fe5786732b4c1 (patch) | |
tree | 49a8cf2a35360d610138924c0a284fc1ed2eca5a | |
parent | 3f4865c67b72a81ae00ae7282c23540e79d42356 (diff) |
lava-jobs.el: make sure lava-jobs-find-running-by-name doesn't barf
If we haven't got a desc yet don't bomb out.
-rw-r--r-- | lava-jobs.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lava-jobs.el b/lava-jobs.el index 96b1fc3..4073037 100644 --- a/lava-jobs.el +++ b/lava-jobs.el @@ -96,14 +96,17 @@ nil))) (defun lava-jobs-find-running-job-by-name (name) - "Return a list of running jobs that match the job description" + "Return a list of running jobs that match the job description." (-filter (lambda (job) - (let ((info-hash (lava-jobs-get-hash job))) - (string-match-p name (gethash "description" info-hash)))) + (let* ((info-hash (lava-jobs-get-hash job)) + (info-desc (gethash "description" info-hash))) + (and info-desc + (string-match-p name info-desc)))) (-map 'car lava-job-info))) ; (lava-jobs-find-running-job-by-name "mustang-cloudimg-hacking-session") +;(lava-jobs-find-running-job-by-name "mustang-hacking-session") (defun lava-jobs-filter-by-state (state list-of-jobs) "Return a list of jobs in a given state" |