From e23e794730174ef6a389b006f92116f3d9708168 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Wed, 19 Jun 2024 12:13:31 -0400 Subject: [PATCH] CanvasBox no longer crashes on nil drawer --- internal/system/canvasbox.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/system/canvasbox.go b/internal/system/canvasbox.go index a59e1e7..c88b3e3 100644 --- a/internal/system/canvasbox.go +++ b/internal/system/canvasbox.go @@ -30,6 +30,8 @@ func (this *canvasBox) Invalidate () { func (this *canvasBox) Draw (can canvas.Canvas) { this.box.Draw(can) - this.userDrawer.Draw ( - can.SubCanvas(this.padding.Apply(this.innerClippingBounds))) + if this.userDrawer != nil { + this.userDrawer.Draw ( + can.SubCanvas(this.padding.Apply(this.innerClippingBounds))) + } }