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>
@if (@event.DtStart != null)
{
<div> <div>
<strong>Start:</strong> @e.DtStart <strong>Start:</strong> @(@event.DtStart)
</div> </div>
}
@if (@event.DtEnd != null)
{
<div> <div>
<strong>End:</strong> @e.DtEnd <strong>End:</strong> @(@event.DtEnd)
</div> </div>
<div class="event-description-short">@e.Description</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>
@if (_event.DtStart != null)
{
<div> <div>
<strong>Start:</strong> @_event.DtStart <strong>Start:</strong> @_event.DtStart
</div> </div>
}
@if (_event.DtEnd != null)
{
<div> <div>
<strong>End:</strong> @_event.DtEnd <strong>End:</strong> @_event.DtEnd
</div> </div>
}
<p class="event-description">@_event.Description</p> <p class="event-description">@_event.Description</p>
} }