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
While creating a URL query parameter using the TableState.SortLabel property, I got a NullReferenceException even though the SortLabel type is declared as "string" instead of "string?".
Current Definition:
public class TableState
{
public int Page { get; set; }
public int PageSize { get; set; }
public string SortLabel { get; set; }
public SortDirection SortDirection { get; set; }
}
Expected Definition 1
public class TableState
{
public int Page { get; set; }
public int PageSize { get; set; }
public string SortLabel { get; set; } = string.Empty;
public SortDirection SortDirection { get; set; }
}
Expected Definition 2
public class TableState
{
public int Page { get; set; }
public int PageSize { get; set; }
public string? SortLabel { get; set; }
public SortDirection SortDirection { get; set; }
}
Expected behavior
Since the property is defined as "string" I would expect it to be initialized to an empty string. Alternatively, the definition could be changed to indicate a possible null value "string?".
While creating a URL query parameter using the TableState.SortLabel property, I got a NullReferenceException even though the SortLabel type is declared as "string" instead of "string?".
As you can see from this issue #6535 Table component is not yet annotated with nullable, therefore this rule doesn't apply here.
Bug type
Component
Component name
MudTable / TableState
What happened?
While creating a URL query parameter using the TableState.SortLabel property, I got a NullReferenceException even though the SortLabel type is declared as "string" instead of "string?".
Current Definition:
Expected Definition 1
Expected Definition 2
Expected behavior
Since the property is defined as "string" I would expect it to be initialized to an empty string. Alternatively, the definition could be changed to indicate a possible null value "string?".
Reproduction link
https://try.mudblazor.com/why
Reproduction steps
...
Relevant log output
No response
Version (bug)
6.9.0
Version (working)
No response
What browsers are you seeing the problem on?
Firefox, Chrome, Microsoft Edge
On what operating system are you experiencing the issue?
Windows
Pull Request
Code of Conduct
The text was updated successfully, but these errors were encountered: