Skip to content

Commit

Permalink
EventHandlerService: Exception caused by usage of incorrect IsNullOrE…
Browse files Browse the repository at this point in the history
…mpty method (#828)

* fix: don't use IsNullOrEmpty of IdentityModel

* refactor: use IsNullOrEmpty extension method

* fix: unanswered relationships crash identity details

---------

Co-authored-by: Julian König <[email protected]>
  • Loading branch information
tnotheis and jkoenig134 authored Sep 2, 2024
1 parent 8fce9d5 commit 8f92e8c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ class IdentityRelationshipDataTableSource extends AsyncDataTableSource {
),
),
DataCell(
Tooltip(
message:
'${DateFormat.yMd(locale.languageCode).format(relationship.$2.answeredAt)} ${DateFormat.Hms().format(relationship.$2.answeredAt)}',
child: Text(DateFormat.yMd(locale.languageCode).format(relationship.$2.answeredAt)),
),
relationship.$2.answeredAt == null
? const Text('-')
: Tooltip(
message:
'${DateFormat.yMd(locale.languageCode).format(relationship.$2.answeredAt!)} ${DateFormat.Hms().format(relationship.$2.answeredAt!)}',
child: Text(DateFormat.yMd(locale.languageCode).format(relationship.$2.answeredAt!)),
),
),
DataCell(Text(relationship.$2.createdByDevice)),
DataCell(Text(relationship.$2.answeredByDevice)),
DataCell(Text(relationship.$2.answeredByDevice ?? '-')),
],
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class Relationship {
final String templateId;
final String status;
final DateTime creationDate;
final DateTime answeredAt;
final DateTime? answeredAt;
final String createdByDevice;
final String answeredByDevice;
final String? answeredByDevice;

Relationship({
required this.peer,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
using Backbone.BuildingBlocks.Domain.Events;
using Backbone.BuildingBlocks.Infrastructure.CorrelationIds;
using Backbone.BuildingBlocks.Infrastructure.EventBus.Json;
using Backbone.Tooling.Extensions;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;

namespace Backbone.BuildingBlocks.Infrastructure.EventBus.AzureServiceBus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Backbone.BuildingBlocks.Domain.Events;
using Backbone.BuildingBlocks.Infrastructure.CorrelationIds;
using Backbone.BuildingBlocks.Infrastructure.EventBus.Json;
using Backbone.Tooling.Extensions;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Polly;
Expand Down Expand Up @@ -168,7 +169,7 @@ private IModel CreateConsumerChannel()
try
{
var correlationId = eventArgs.BasicProperties.CorrelationId;
correlationId = string.IsNullOrEmpty(correlationId) ? Guid.NewGuid().ToString() : correlationId;
correlationId = correlationId.IsNullOrEmpty() ? Guid.NewGuid().ToString() : correlationId;

using (CustomLogContext.SetCorrelationId(correlationId))
{
Expand Down

0 comments on commit 8f92e8c

Please sign in to comment.