fixed error check using the wrong error value Upstream-commit: d301146c4b7b788f77b6ae77a574e75174a7f8d5 Component: engine