Skip to content

Commit 4f00d47

Browse files
committed
fix: Oops
fixes #20
1 parent e29b20d commit 4f00d47

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

CFLookup/Pages/Index.cshtml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
}
257257
else
258258
{
259-
var modClass = Model.FoundCategories.Where(c => c.Id == Model.FoundMod.ClassId);
259+
var modClass = Model.FoundCategories?.Where(c => c.Id == Model.FoundMod.ClassId);
260260
<hr />
261261
@if (Model.FoundMod.Logo != null && !string.IsNullOrWhiteSpace(Model.FoundMod.Logo.ThumbnailUrl))
262262
{
@@ -271,15 +271,15 @@
271271
<h2>@Model.FoundMod.Name</h2>
272272
}
273273
<p><i>@Model.FoundMod.Summary</i></p>
274-
<div class="row justify-content-center">
275-
@if (Model.FoundGame != null)
276-
{
277-
<div class="mb-3 row justify-content-start">
278-
<div class="col-md-12 text-start">
279-
<h3><img src="@Model.FoundGame.Assets.IconUrl" alt="Game icon: @Model.FoundGame.Name" /> @Model.FoundGame.Name</h3>
280-
</div>
274+
@if (Model.FoundGame != null)
275+
{
276+
<div class="row justify-content-center">
277+
<div class="col-md-6">
278+
<h3><img src="@Model.FoundGame.Assets.IconUrl" alt="Game icon: @Model.FoundGame.Name" /> @Model.FoundGame.Name</h3>
281279
</div>
282-
}
280+
</div>
281+
}
282+
<div class="row justify-content-center">
283283
<div class="col-md-6">
284284
<table class="table table-striped table-dark text-start table-bordered caption-top">
285285
<caption>Project information</caption>

CFLookup/Pages/Index.cshtml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ public async Task OnGet(int? projectId = null, int? fileId = null, bool? rcf = f
7676
}
7777
}
7878
}
79+
80+
if (FoundMod != null)
81+
{
82+
FoundGame = (await _cfApiClient.GetGameAsync(FoundMod.GameId)).Data;
83+
FoundCategories = (await _cfApiClient.GetCategoriesAsync(FoundMod.GameId)).Data;
84+
}
7985
}
8086

8187
public bool IsDiscord { get; set; } = false;

0 commit comments

Comments
 (0)