Skip to content

Commit

Permalink
Fix an issue caused exceptions while obtaining the building's service
Browse files Browse the repository at this point in the history
  • Loading branch information
dymanoid committed Jul 24, 2018
1 parent f7b7ae5 commit 8861242
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/RealTime/GameConnection/BuildingManagerConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ public void GetBuildingService(ushort buildingId, out ItemClass.Service service,
return;
}

ref ItemClass itemClass = ref BuildingManager.instance.m_buildings.m_buffer[buildingId].Info.m_class;
ItemClass itemClass = BuildingManager.instance.m_buildings.m_buffer[buildingId].Info?.m_class;
if (itemClass == null)
{
service = ItemClass.Service.None;
subService = ItemClass.SubService.None;
return;
}

service = itemClass.m_service;
subService = itemClass.m_subService;
}
Expand Down

0 comments on commit 8861242

Please sign in to comment.