Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(sass): fix potential null pointer, though it really should never …
Browse files Browse the repository at this point in the history
…happen
  • Loading branch information
danbucholtz committed Jul 13, 2017
1 parent f85ade0 commit 427e556
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/sass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ function generateSassData(context: BuildContext, sassConfig: SassConfig) {
*/

const moduleDirectories: string[] = [];
context.moduleFiles.forEach(moduleFile => {
const moduleDirectory = dirname(moduleFile);
if (moduleDirectories.indexOf(moduleDirectory) < 0) {
moduleDirectories.push(moduleDirectory);
}
});
if (context.moduleFiles) {
context.moduleFiles.forEach(moduleFile => {
const moduleDirectory = dirname(moduleFile);
if (moduleDirectories.indexOf(moduleDirectory) < 0) {
moduleDirectories.push(moduleDirectory);
}
});
}

Logger.debug(`sass moduleDirectories: ${moduleDirectories.length}`);

Expand Down

0 comments on commit 427e556

Please sign in to comment.