Skip to content

Commit 9f05520

Browse files
committed
check splitData for null and undefined
1 parent b8e1981 commit 9f05520

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/optimize/AggressiveSplittingPlugin.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,19 @@ class AggressiveSplittingPlugin {
9191
newChunk._fromAggressiveSplitting = true;
9292
if(j < savedSplits.length)
9393
newChunk._fromAggressiveSplittingIndex = j;
94-
if(splitData.id !== null) newChunk.id = splitData.id;
94+
if(splitData.id !== null && splitData.id !== undefined) {
95+
newChunk.id = splitData.id;
96+
}
9597
newChunk.origins = chunk.origins.map(copyWithReason);
9698
chunk.origins = chunk.origins.map(copyWithReason);
9799
return true;
98100
} else {
99101
if(j < savedSplits.length)
100102
chunk._fromAggressiveSplittingIndex = j;
101103
chunk.name = null;
102-
if(splitData.id !== null) chunk.id = splitData.id;
104+
if(splitData.id !== null && splitData.id !== undefined) {
105+
chunk.id = splitData.id;
106+
}
103107
}
104108
}
105109
}

0 commit comments

Comments
 (0)