Fix for JENKINS-16657

Added null-check for `action` in `isBuildClaimed`