Converting null literal or possible null value to non-nullable type

Find() can return null when what you’re looking for is not found. So destinationProperty can become null.

So the solution would be to declare it as nullable:

PropertyInfo? destinationProperty = ...

Or to throw an exception:

PropertyInfo destinationProperty = ...Find() ?? throw new ArgumentException(...)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)