From 3853c02e7e51b2cc4c45074c775225c41b4591a2 Mon Sep 17 00:00:00 2001 From: Mika Herrmann Date: Thu, 19 Dec 2024 13:57:02 +0100 Subject: [PATCH] fix: Only throw if no entry was found at all --- .../NotificationTexts/PushNotificationTextProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Devices/src/Devices.Infrastructure/PushNotifications/NotificationTexts/PushNotificationTextProvider.cs b/Modules/Devices/src/Devices.Infrastructure/PushNotifications/NotificationTexts/PushNotificationTextProvider.cs index a1cd69fb1a..b2ab915f23 100644 --- a/Modules/Devices/src/Devices.Infrastructure/PushNotifications/NotificationTexts/PushNotificationTextProvider.cs +++ b/Modules/Devices/src/Devices.Infrastructure/PushNotifications/NotificationTexts/PushNotificationTextProvider.cs @@ -42,10 +42,10 @@ private NotificationText GetNotificationTextFromResourceManager(Type pushNotific var title = _resourceManager.GetString(titleKey, culture); var body = _resourceManager.GetString(bodyKey, culture); - if (title.IsNullOrEmpty()) + if (title == null) throw new MissingPushNotificationTextException($"Title for notification type '{pushNotificationTypeName}' not found."); - if (body.IsNullOrEmpty()) + if (body == null) throw new MissingPushNotificationTextException($"Body for notification type '{pushNotificationTypeName}' not found."); return new NotificationText(title, body);