Skip to content

Commit

Permalink
Add check for event in hasAttributes (#2053)
Browse files Browse the repository at this point in the history
* Add check for event

* Add gap

* Use undefined check
  • Loading branch information
Alex-Tideman authored Apr 29, 2024
1 parent a837cdc commit dfbe3b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/event/event-summary-row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
{/if}
</p>
{#if duration && duration !== '0ms'}
<div class="flex flex-row items-center gap-0">
<div class="flex flex-row items-center gap-1">
<Icon class="inline" name="clock" />
<p class="break-word truncate text-sm md:whitespace-normal">
{duration}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utilities/is-event-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ export const findAttributesAndKey = (

const hasAttributes =
<T extends EventWithAttributes<EventAttributeKey>>(key: EventAttributeKey) =>
(event: IterableEvent | CommonHistoryEvent): event is T => {
return Boolean(event[key]);
(event: IterableEvent | CommonHistoryEvent | undefined): event is T => {
return Boolean(event?.[key]);
};

export const isWorkflowExecutionStartedEvent =
Expand Down

0 comments on commit dfbe3b6

Please sign in to comment.