mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Null out mainPath on resolve errors
The scope of this variable is outside the loop so this prevent cache corruption based on using the mainPath value from previous module. Refs atom/atom-space-pen-views#5
This commit is contained in:
@@ -59,6 +59,8 @@ loadDependencies = (modulePath, rootPath, rootMetadata, moduleCache) ->
|
||||
if childMetadata?.version
|
||||
try
|
||||
mainPath = require.resolve(childPath)
|
||||
catch error
|
||||
mainPath = null
|
||||
|
||||
if mainPath
|
||||
moduleCache.dependencies.push
|
||||
|
||||
Reference in New Issue
Block a user