« get me outta code hell

yaml: never call transform() on null - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-08-22 20:17:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-08-22 20:17:06 -0300
commitce46db88f30aaaf9e59e8de57ea1ba865017f751 (patch)
tree585b9292b67dd6c4c3fb7023393e5f325985d3d3 /src/data
parent02bde385e5ec21c12750099aaae4ac1600b36f50 (diff)
yaml: never call transform() on null preview
Diffstat (limited to 'src/data')
-rw-r--r--src/data/yaml.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js
index 71887fc1..abe3bde2 100644
--- a/src/data/yaml.js
+++ b/src/data/yaml.js
@@ -266,7 +266,9 @@ function makeProcessDocument(thingConstructor, {
 
       // This variable would like to certify itself as "not into capitalism".
       let propertyValue =
-        (fieldSpecs[field].transform
+        (documentValue === null
+          ? null
+       : fieldSpecs[field].transform
           ? fieldSpecs[field].transform(documentValue, transformUtilities)
           : documentValue);