Fix NRE if package download fails or is corrupted.

This commit is contained in:
Matthias Mailänder
2016-04-17 14:19:24 +02:00
parent c2c26cbcdc
commit 48ea9dc300

View File

@@ -486,8 +486,13 @@ namespace OpenRA
Game.RunAfterTick(() =>
{
var package = modData.ModFiles.OpenPackage(mapFilename, mapInstallPackage);
UpdateFromMap(package, mapInstallPackage, MapClassification.User, null, GridType);
onSuccess();
if (package == null)
innerData.Status = MapStatus.DownloadError;
else
{
UpdateFromMap(package, mapInstallPackage, MapClassification.User, null, GridType);
onSuccess();
}
});
};