fix error when a location doesn't have a map asset key
This commit is contained in:
parent
8ff4111027
commit
085b1be28c
|
@ -2,6 +2,7 @@
|
|||
## 2.9.1
|
||||
* For players:
|
||||
* Fixed crash in SMAPI 2.9 when constructing certain buildings.
|
||||
* Fixed error when a map asset is reloaded in rare cases.
|
||||
|
||||
## 2.9
|
||||
* For players:
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace StardewModdingAPI.Metadata
|
|||
bool anyChanged = false;
|
||||
foreach (GameLocation location in this.GetLocations())
|
||||
{
|
||||
if (this.GetNormalisedPath(location.mapPath.Value) == key)
|
||||
if (!string.IsNullOrWhiteSpace(location.mapPath.Value) && this.GetNormalisedPath(location.mapPath.Value) == key)
|
||||
{
|
||||
this.Reflection.GetMethod(location, "reloadMap").Invoke();
|
||||
this.Reflection.GetMethod(location, "updateWarps").Invoke();
|
||||
|
|
Loading…
Reference in New Issue