From 35987fc0b310ae9785bda7ee77f506fd0152a39e Mon Sep 17 00:00:00 2001 From: gucio321 Date: Wed, 29 Sep 2021 11:56:13 +0200 Subject: [PATCH] style setter: fix bug, when pushing nil font caused crash --- Style.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Style.go b/Style.go index 109310f5..a878cec4 100644 --- a/Style.go +++ b/Style.go @@ -10,10 +10,15 @@ import ( // NOTE: PopFont has to be called // NOTE: Don't use PushFont. use StyleSetter instead func PushFont(font *FontInfo) bool { + if font == nil { + return false + } + if f, ok := extraFontMap[font.String()]; ok { imgui.PushFont(*f) return true } + return false }