Skip to content

Commit a8448d2

Browse files
franciscopXhmikosR
authored andcommitted
Default data to "{}" (#173)
Defaults the data to {} so later we can access it as an object. Fixes #168
1 parent a02facd commit a8448d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tasks/pug.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ module.exports = function(grunt) {
6666
// if data is function, bind to f.orig, passing f.dest and f.src
6767
f.orig.data = data.call(f.orig, f.dest, f.src);
6868
} else {
69-
f.orig.data = data;
69+
// Defaults data to an empty object {}
70+
f.orig.data = data || {};
7071
}
7172
if (options.filters) {
7273
if (!f.orig.data.filters) {

0 commit comments

Comments
 (0)