Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AttributeErrors for stop and info commands #45

Merged
merged 2 commits into from
Jun 3, 2017

Conversation

radomirbosak
Copy link
Contributor

The AttributeError was causes by this line:

last_build = job_info.get('lastBuild', {})
...
last_build.get('something')

If the job_info var contains the lastBuild key, but it's None, the result is still None and not empty dict.

This reformulation should fix it:

last_build = job_info['lastBuild'] or {}

The empty dict gets used whenever job_info['lastBuild'] evaluates as False (None does evaluate to False)

@LD250
Copy link
Owner

LD250 commented Jun 3, 2017

Thank you for fix, @radomirbosak !

@LD250 LD250 merged commit cda355c into LD250:master Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants