Closed ShortDevelopment closed 5 months ago
Yeah, I always wanted to fix this someday, but haven't found the time to do so. Expect this fixed in the next version.
null
is now an allowed value and is treated equally to an "empty instance" of the type.
Completed with the release of 0.016 on NuGet, see https://www.nuget.org/packages/Tmds.DBus.SourceGenerator/0.0.16.
Issue
Unused collection properties are initialized as
null
. Therfore the handler code might throw aNullReferenceException
.Solution
Initialize generated collection properties to
Array<T>.Empty()
,new Dictionary<A, B>()
ornew List<T>()
.