Bug 913614 - When the input is invalid, skip the work as we won't get anything useful anyway. r=jmuizelaar, a=bbajaj