Fixed error check using the wrong error value Upstream-commit: c8999dc326c9d722386c88ba6cca219b8029452e Component: engine