From 3819548abccc7eea529064ccb90a838a23ccc019 Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Tue, 11 Aug 2020 16:22:25 -0400 Subject: [PATCH] Fix crash in certain scenarios where there would be no imgui window to render --- engine/renderer/src/imguipass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/renderer/src/imguipass.cpp b/engine/renderer/src/imguipass.cpp index 9cc1bf8..c67ad49 100755 --- a/engine/renderer/src/imguipass.cpp +++ b/engine/renderer/src/imguipass.cpp @@ -85,6 +85,9 @@ void ImGuiPass::render_post(GFXCommandBuffer* command_buffer, const int index) { Expects(draw_data != nullptr); + if(draw_data->TotalIdxCount == 0 || draw_data->TotalVtxCount == 0) + return; + const int framebuffer_width = static_cast(draw_data->DisplaySize.x * draw_data->FramebufferScale.x); const int framebuffer_height = static_cast(draw_data->DisplaySize.y * draw_data->FramebufferScale.y);