Skip to content

Commit e761a86

Browse files
committed
fix: possible null pointer deref (releated to #26)
1 parent 3d1485e commit e761a86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

imgui_skia/imgui_skia_impl/imgui_skia_imzero_cmd_render.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,10 @@ void ImGuiSkia::VectorCmdSkiaRenderer::drawCmdRenderTextFB(const ImZeroFB::CmdRe
937937
auto size = cmd.size();
938938
auto font = fFont.makeWithSize(SkScalarToFloat(size));
939939
const auto text = cmd.text();
940+
if(text == nullptr) {
941+
canvas.restore();
942+
return;
943+
}
940944

941945
float dy;
942946
{ ZoneScoped;

0 commit comments

Comments
 (0)