OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
208 stars 112 forks source link

Clean up lots of warnings in DreamProcNativeRoot.cs #1923

Closed TheTyrant25 closed 2 months ago

TheTyrant25 commented 3 months ago

By adding ! and ? at strategic locations, as well as some other changes, the warnings about dereferencing/referencing of null/nullable types are removed. in (presumably) all the cases where the warning exists there are already circumstances that make it so that the errors being warned against can't happen anyway, so these shouldn't hurt. fingers crossed.

The file has gone from having 39 warnings to only 14.

Some of the warnings that are more legitimate in origin have been left in.

wixoaGit commented 3 months ago

Using ! is generally something to avoid since it's suppressing an actual potential issue. It's better to instead do things differently to ensure the value could never be null, or check if the value is null and handle it accordingly.

TheTyrant25 commented 3 months ago

oh huh it's failing ubuntu-latest build test and release