diff --git a/src/runtime/vulkan/vulkan.cc b/src/runtime/vulkan/vulkan.cc index ff1b82f930d73..b3a7609034ed4 100644 --- a/src/runtime/vulkan/vulkan.cc +++ b/src/runtime/vulkan/vulkan.cc @@ -192,6 +192,10 @@ class VulkanDeviceAPI final : public DeviceAPI { // finish all the vulkan commands that reference the buffer. StreamSync(ctx, nullptr); + if (ptr == nullptr) { + return; + } + const auto& vctx = context(ctx.device_id); auto* pbuf = static_cast(ptr); vkDestroyBuffer(vctx.device, pbuf->buffer, nullptr);