diff --git a/runtime/js_eval.cpp b/runtime/js_eval.cpp index 9db28f3fa4c97ab2c4cfc6d9932a75de9a93d098..0dcfcb8263045224e3f616c2e2b55fd1ef316523 100644 --- a/runtime/js_eval.cpp +++ b/runtime/js_eval.cpp @@ -34,8 +34,9 @@ JSTaggedValue EvalUtils::GetEvaluatedScript(JSThread *thread, const JSHandleGetEcmaVM()->GetFactory(); if (!program) { - const auto &err = compiler.GetError(); - JSHandle error = objectFactory->GetJSError(ErrorType::SYNTAX_ERROR, err.Message().c_str()); + const auto *err = compiler.GetError(); + ASSERT(err != nullptr); + JSHandle error = objectFactory->GetJSError(ErrorType::SYNTAX_ERROR, err->Message().c_str()); THROW_NEW_ERROR_AND_RETURN_VALUE(thread, error.GetTaggedValue(), JSTaggedValue::Exception()); }