mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Protect against edge case when resolved is a string.
In particular, if the "main" field of the package.json file cannot be resolved, then the `resolved` variable will be "missing", which is a truthy value that silently rejects property assignments. Ugh!
This commit is contained in:
@@ -316,7 +316,7 @@ export default class Resolver {
|
||||
const resolved = this._joinAndStat(dirPath, main) ||
|
||||
this._resolve(main, pkgJsonPath, _seenDirPaths);
|
||||
|
||||
if (resolved) {
|
||||
if (resolved && typeof resolved === "object") {
|
||||
if (! resolved.packageJsonMap) {
|
||||
resolved.packageJsonMap = Object.create(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user