Check slave before trying to access it.
Fix syntax error.
Merge bhearsum/buildbot:check-slave (PR #1019)