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

View file

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