Skip to content

Commit 6da1272

Browse files
author
Ray Schamp
committed
fix: increase strictness of BuiltinHelper
BuiltinHelper should not cache ids of `undefined` or `null`. BREAKING CHANGE: Began throwing errors when attempting to use `BuiltinHelper.cache` with non-existy ids
1 parent e1e13b6 commit 6da1272

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/BuiltinHelper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ class BuiltinHelper extends Helper {
106106
if (this.assets.hasOwnProperty(id) && assetType.immutable) return id;
107107
} else if (assetType.immutable) {
108108
id = md5(data);
109+
} else {
110+
throw new Error('Tried to cache data without an id');
109111
}
110112
this.assets[id] = {
111113
type: assetType,

0 commit comments

Comments
 (0)