You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call databases.CreateStringAttribute and Required is set to true, and Default is set to null.
👍 Expected behavior
It should create the attribute and return the result.
👎 Actual Behavior
It actually creates the attribute but then throws a NullReferenceException.
The Exception is thrown in this method:
public static AttributeString From(Dictionary<string, object> map) => new AttributeString(
key: map["key"].ToString(),
type: map["type"].ToString(),
status: map["status"].ToString(),
error: map["error"].ToString(),
required: (bool)map["required"],
array: (bool?)map["array"],
size: Convert.ToInt64(map["size"]),
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
);
After changing the line xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
to xdefault: map.TryGetValue("default", out var xdefault) && xdefault != null ? xdefault.ToString() : null
it works.
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Windows
🧱 Your Environment
I use the dotnet sdk nuget package 0.8.3.
👀 Have you spent some time to check if this issue has been raised before?
👟 Reproduction steps
When I call databases.CreateStringAttribute and Required is set to true, and Default is set to null.
👍 Expected behavior
It should create the attribute and return the result.
👎 Actual Behavior
It actually creates the attribute but then throws a NullReferenceException.
The Exception is thrown in this method:
After changing the line
xdefault: map.TryGetValue("default", out var xdefault) ? xdefault.ToString() : null
to
xdefault: map.TryGetValue("default", out var xdefault) && xdefault != null ? xdefault.ToString() : null
it works.
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Windows
🧱 Your Environment
I use the dotnet sdk nuget package 0.8.3.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: