Check for undefined and log it instead of blowing up