Permalink
Browse files

fix(sass): fix potential null pointer, though it really should never …

…happen
  • Loading branch information...
danbucholtz committed Jul 13, 2017
1 parent f85ade0 commit 427e556460265da817a5975567ded2a00e5cb8bd
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/sass.ts
@@ -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}`);

0 comments on commit 427e556

Please sign in to comment.