|
|
@@ -7,7 +7,7 @@ namespace MQTTnet.Extensions |
|
|
|
{ |
|
|
|
public static string GetUserProperty(this MqttApplicationMessage message, string propertyName, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase) |
|
|
|
{ |
|
|
|
return message.UserProperties.SingleOrDefault(up => up.Name.Equals(propertyName, comparisonType))?.Value; |
|
|
|
return message?.UserProperties?.SingleOrDefault(up => up.Name.Equals(propertyName, comparisonType))?.Value; |
|
|
|
} |
|
|
|
|
|
|
|
public static T GetUserProperty<T>(this MqttApplicationMessage message, string propertyName, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase) |
|
|
|