Might be better to just check if the error is truthy; otherwise, the error being `null` or something like that could trigger this.