Cast getBuild to accomodate changed API in newer Jenkins version.