Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning CS8602: 'Dereference of a possibly null reference' in MudDataGrid PropertyColumn #7197

Closed
1 of 2 tasks
o-khytrov opened this issue Jul 12, 2023 · 1 comment
Closed
1 of 2 tasks

Comments

@o-khytrov
Copy link
Contributor

Bug type

Component

Component name

MudDataGrid

What happened?

When a project is using nullable reference types <Nullable>enable</Nullable>, building a page with property column in MudDataGrid produces warnings

warning CS8602: Dereference of a possibly null reference.

Expected behavior

The build is successful without warnings

Reproduction link

https://try.mudblazor.com/snippet/wkcxkBlczUeAshBC

Reproduction steps

  1. Checkout Mudblazor repository
  2. Enable nullable reference types in MudBlazor.Docs project
  3. Build Solution.
  4. Debug output contains warnings
    \src\MudBlazor.Docs\Pages\Components\DataGrid\Examples\DataGridAdvancedExample.razor(16,40,16,41): warning CS8602: Dereference of a possibly null reference. \src\MudBlazor.Docs\Pages\Components\DataGrid\Examples\DataGridAdvancedExample.razor(17,40,17,41): warning CS8602: Dereference of a possibly null reference. \src\MudBlazor.Docs\Pages\Components\DataGrid\Examples\DataGridAdvancedExample.razor(19,40,19,41): warning CS8602: Dereference of a possibly null reference. \src\MudBlazor.Docs\Pages\Components\DataGrid\Examples\DataGridAdvancedExample.razor(20,40,20,41): warning CS8602: Dereference of a possibly null reference. \src\MudBlazor.Docs\Pages\Components\DataGrid\Examples\DataGridAdvancedExample.razor(21,40,21,41): warning CS8602: Dereference of a possibly null reference.
    ...

Relevant log output

No response

Version (bug)

6.7.0

Version (working)

No response

What browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge, Safari

On what operating system are you experiencing the issue?

Windows, Linux

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct
@o-khytrov o-khytrov changed the title Warning CS8602: Dereference of a possibly null reference. In MudDataGrid PropertyColumn Warning CS8602: Dereference of a possibly null reference in MudDataGrid PropertyColumn Jul 12, 2023
@o-khytrov o-khytrov changed the title Warning CS8602: Dereference of a possibly null reference in MudDataGrid PropertyColumn Warning CS8602: 'Dereference of a possibly null reference' in MudDataGrid PropertyColumn Jul 12, 2023
@ScarletKuro
Copy link
Member

Hi.
MudBlazor and its projects (such as the MudBlazor.Docs) have not been completely annotated with nullable safety yet. As a result, you may encounter warnings like above.
You can keep track on progress here #6535
Considering that there is already a primary issue, I will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants