Skip to content

Commit

Permalink
webapp/alerts: safer handling of values that could be null
Browse files Browse the repository at this point in the history
Like an empty DNS queries array.

Spotted by Victor Julien.
  • Loading branch information
jasonish committed Nov 30, 2024
1 parent e6c6ed1 commit 4262ffa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webapp/src/Alerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1049,27 +1049,27 @@ export function AlertDescription(props: { event: EventWrapper }) {
</Show>
<Show when={props.event._source.tls?.sni}>
<span class="badge text-bg-secondary me-2">
{props.event._source.tls!.sni}
{props.event?._source?.tls?.sni}
</span>
</Show>
<Show when={props.event._source.quic?.sni}>
<span class="badge text-bg-secondary me-2">
{props.event._source.quic!.sni}
{props.event?._source?.quic?.sni}
</span>
</Show>
<Show when={props.event._source.dns?.query}>
<span class="badge text-bg-secondary me-2">
{props.event._source.dns?.query![0].rrname}
{props.event?._source?.dns?.query?.[0]?.rrname}
</span>
</Show>
<Show when={props.event._source.dns?.queries}>
<span class="badge text-bg-secondary me-2">
{props.event._source.dns?.queries![0].rrname}
{props.event?._source?.dns?.queries?.[0]?.rrname}
</span>
</Show>
<Show when={props.event._source.http?.hostname}>
<span class="badge text-bg-secondary me-2">
{props.event._source.http?.hostname}
{props.event?._source?.http?.hostname}
</span>
</Show>
<Show
Expand Down

0 comments on commit 4262ffa

Please sign in to comment.