Skip to content

Commit 5761600

Browse files
committed
fix building has no tab throw exception
1 parent 50277e3 commit 5761600

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

TbsCore/Helpers/NavigationHelper.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,14 @@ public static async Task<bool> EnterBuilding(Account acc, Building building, int
224224
// Enter building (if not already there)
225225
await ToBuildingId(acc, building.Id);
226226

227-
if (tab != null) // Navigate to correct tab
227+
if (BuildingsData.HasMultipleTabs(building.Type))
228228
{
229-
var currentTab = InfrastructureParser.CurrentlyActiveTab(acc.Wb.Html);
230-
// Navigate to correct tab if not already on it
231-
if (currentTab != tab) await DriverHelper.ClickByClassName(acc, "tabItem", (int)tab);
229+
if (tab != null) // Navigate to correct tab
230+
{
231+
var currentTab = InfrastructureParser.CurrentlyActiveTab(acc.Wb.Html);
232+
// Navigate to correct tab if not already on it
233+
if (currentTab != tab) await DriverHelper.ClickByClassName(acc, "tabItem", (int)tab);
234+
}
232235
}
233236
break;
234237

0 commit comments

Comments
 (0)