mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-28 11:42:28 +00:00
Fix error when slot on case does not exist
This commit is contained in:
parent
f0a9fc324f
commit
643b00512a
2 changed files with 14 additions and 8 deletions
|
@ -40,13 +40,19 @@
|
|||
|
||||
@if (Model.Type.AffectsLevel())
|
||||
{
|
||||
Slot slot = await Model.GetSlotAsync(database);
|
||||
<p><strong>Affected level:</strong> <a href="/slot/@slot.SlotId">@slot.Name</a></p>
|
||||
Slot? slot = await Model.GetSlotAsync(database);
|
||||
if (slot != null)
|
||||
{
|
||||
<p><strong>Affected level:</strong> <a href="/slot/@slot.SlotId">@slot.Name</a></p>
|
||||
}
|
||||
}
|
||||
else if (Model.Type.AffectsUser())
|
||||
{
|
||||
User user = await Model.GetUserAsync(database);
|
||||
<p><strong>Affected user:</strong> <a href="/user/@user.UserId">@user.Username</a></p>
|
||||
User? user = await Model.GetUserAsync(database);
|
||||
if (user != null)
|
||||
{
|
||||
<p><strong>Affected user:</strong> <a href="/user/@user.UserId">@user.Username</a></p>
|
||||
}
|
||||
}
|
||||
|
||||
<h3>Reason</h3>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue