Skip to content

Commit b78eaee

Browse files
committed
Fix 'info' command fail when there are no builds
Fixes #44
1 parent 58db8f4 commit b78eaee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

jenkins_cli/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ def info(self, args):
175175
job_info = self.jenkins.get_job_info(job_name, 1)
176176
if not job_info:
177177
job_info = {}
178-
last_build = job_info.get('lastBuild', {})
179-
last_success_build = job_info.get('lastSuccessfulBuild', {})
178+
last_build = job_info.get('lastBuild') or {}
179+
last_success_build = job_info.get('lastSuccessfulBuild') or {}
180180
xml = self.jenkins.get_job_config(job_name)
181181
root = ElementTree.fromstring(xml.encode('utf-8'))
182182
scm_name, branch_node = self._get_scm_name_and_node(root)

0 commit comments

Comments
 (0)