Fixes hotcode reloading issue

Reviewed By: martinbigio

Differential Revision: D3136032

fb-gh-sync-id: 5666fd45ffa574d2156b03c7bfbda3fe97090f56
fbshipit-source-id: 5666fd45ffa574d2156b03c7bfbda3fe97090f56
This commit is contained in:
Thomas Aylott 2016-04-06 12:13:36 -07:00 committed by Facebook Github Bot 9
parent 65b0f7c868
commit f9a9cd6f25
2 changed files with 6 additions and 5 deletions

View File

@ -390,10 +390,11 @@ class Bundler {
const numModuleSystemDependencies =
this._resolver.getModuleSystemDependencies({dev, unbundle}).length;
entryFilePath = response.dependencies[
(response.numPrependedDependencies || 0) +
numModuleSystemDependencies
].path;
const dependencyIndex = (response.numPrependedDependencies || 0) + numModuleSystemDependencies;
if (dependencyIndex in response.dependencies) {
entryFilePath = response.dependencies[dependencyIndex].path;
}
}
const toModuleTransport = module =>

View File

@ -139,7 +139,7 @@ if (__DEV__) { // HMR
}
function acceptAll(modules, inverseDependencies) {
if (modules.length === 0) {
if (!modules || modules.length === 0) {
return true;
}