Skip to content

Commit f011993

Browse files
committed
Defend the case that WasmHandleBase::wasm() is null for canary function
Signed-off-by: Ingwon Song <igsong@google.com>
1 parent ff3d16a commit f011993

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wasm.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ void WasmBase::finishShutdown() {
449449

450450
bool WasmHandleBase::canary(const std::shared_ptr<PluginBase> &plugin,
451451
const WasmHandleCloneFactory &clone_factory) {
452+
if (this->wasm() == nullptr) {
453+
return false;
454+
}
452455
auto configuration_canary_handle = clone_factory(shared_from_this());
453456
if (!configuration_canary_handle) {
454457
this->wasm()->fail(FailState::UnableToCloneVm, "Failed to clone Base Wasm");

0 commit comments

Comments
 (0)