Don't crash when an invalid branch is passed

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>