Check for null parameters in the interface

This commit is contained in:
Sijmen 2021-07-04 13:39:11 +02:00
parent 021acac780
commit 5f452c026e
Signed by: vijfhoek
GPG Key ID: DAF7821E067D9C48
2 changed files with 33 additions and 16 deletions

View File

@ -14,20 +14,28 @@
else
{
<h1>Calendar "@_calendar.Name"</h1>
@foreach (var e in _events)
@foreach (var @event in _events)
{
<div class="event">
<a href="/calendars/@Id/events/@e.Uid">
<h2>@e.Summary</h2>
<a href="/calendars/@Id/events/@(@event.Uid)">
<h2>@(@event.Summary)</h2>
</a>
<div>
<strong>Start:</strong> @e.DtStart
</div>
<div>
<strong>End:</strong> @e.DtEnd
</div>
<div class="event-description-short">@e.Description</div>
@if (@event.DtStart != null)
{
<div>
<strong>Start:</strong> @(@event.DtStart)
</div>
}
@if (@event.DtEnd != null)
{
<div>
<strong>End:</strong> @(@event.DtEnd)
</div>
}
<div class="event-description-short">@(@event.Description)</div>
</div>
}
}

View File

@ -14,12 +14,21 @@
else
{
<h1>@_event.Summary</h1>
<div>
<strong>Start:</strong> @_event.DtStart
</div>
<div>
<strong>End:</strong> @_event.DtEnd
</div>
@if (_event.DtStart != null)
{
<div>
<strong>Start:</strong> @_event.DtStart
</div>
}
@if (_event.DtEnd != null)
{
<div>
<strong>End:</strong> @_event.DtEnd
</div>
}
<p class="event-description">@_event.Description</p>
}