about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-02 20:53:56 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-02 20:53:56 +0200
commit6ecac397b43de14589c29b601fd9e4d8b8524d9a (patch)
tree42a038147626719c073b3bc83fbc92da77a55e09
parent78e6d4577e5cfce78c7052f7186667e2eab209d5 (diff)
downloadchawan-6ecac397b43de14589c29b601fd9e4d8b8524d9a.tar.gz
cascade: add missing nil check
-rw-r--r--src/css/cascade.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/css/cascade.nim b/src/css/cascade.nim
index 1cee3399..ebb74427 100644
--- a/src/css/cascade.nim
+++ b/src/css/cascade.nim
@@ -417,7 +417,7 @@ proc applyRulesFrameInvalid(frame: CascadeFrame; ua, user: CSSStylesheet;
       styledParent.children.add(styledText)
     of peCanvas:
       let bmp = HTMLCanvasElement(styledParent.node).bitmap
-      if bmp.cacheId != 0:
+      if bmp != nil and bmp.cacheId != 0:
         let content = CSSContent(
           t: ContentImage,
           s: "canvas://",