File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ const pattern_assembler = function () {
85
85
function addPattern ( pattern , patternlab ) {
86
86
87
87
//add the link to the global object
88
+ if ( ! patternlab . data . link ) {
89
+ patternlab . data . link = { } ;
90
+ }
88
91
patternlab . data . link [ pattern . patternPartial ] = '/patterns/' + pattern . patternLink ;
89
92
90
93
//only push to array if the array doesn't contain this pattern
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ module.exports = class PatternLab {
53
53
// INITIALIZE EMPTY GLOBAL DATA STRUCTURES
54
54
//
55
55
this . data = { } ;
56
- this . data . link = { } ;
57
56
this . patterns = [ ] ;
58
57
this . subtypePatterns = { } ;
59
58
this . partials = { } ;
@@ -147,6 +146,7 @@ module.exports = class PatternLab {
147
146
// data.json
148
147
try {
149
148
this . data = this . buildPatternData ( paths . source . data , fs ) ; // eslint-disable-line no-use-before-define
149
+ this . data . link = { } ;
150
150
} catch ( ex ) {
151
151
logger . error ( 'missing or malformed' + paths . source . data + 'data.json Pattern Lab may not work without this file.' ) ;
152
152
this . data = { } ;
You can’t perform that action at this time.
0 commit comments