mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Fix.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user