From a0c7e047f511cad0dc572a12f1cf7f68cf986301 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 3 Aug 2021 15:23:46 +0800 Subject: [PATCH] fix(extern_c_opr): let megbrain throw a exception when load extern c opr fails GitOrigin-RevId: 16f5ceb8e3b0413de80812c3f3b3b75fa8205460 --- src/serialization/impl/extern_c_opr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/serialization/impl/extern_c_opr.cpp b/src/serialization/impl/extern_c_opr.cpp index ec34ffaf8..a8b42cdbd 100644 --- a/src/serialization/impl/extern_c_opr.cpp +++ b/src/serialization/impl/extern_c_opr.cpp @@ -518,6 +518,10 @@ cg::OperatorNodeBase* ExternCOprRunner::load(OprLoadContext& ctx, if (auto trans = iter->second.second) { desc = trans(desc); } + + mgb_throw_if(nullptr == desc, MegBrainError, + "loader create desc returns nullptr"); + return make_from_desc(dump_name, inputs, desc, config); } -- GitLab