Avoid "invalid memory address or nil pointer dereference" panic Upstream-commit: b8c10d8af254a6200de642e246b5a0d9de0dfca8 Component: engine