Don't throw NullReferenceException when accessing .Exception
parent
6a71ba43f6
commit
6c9933a593
|
@ -27,15 +27,7 @@ public class Optional<T>
|
|||
return _exception is not null;
|
||||
}
|
||||
|
||||
public Exception? Exception
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_exception is null)
|
||||
throw new NullReferenceException();
|
||||
return _exception;
|
||||
}
|
||||
}
|
||||
public Exception? Exception => _exception;
|
||||
public T Value
|
||||
{
|
||||
get
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<RepositoryUrl>https://nexus.l--n.de/repository/ln.net/</RepositoryUrl>
|
||||
<UserSecretsId>e910e63e-c2c5-4d40-a00b-bd7c6461757e</UserSecretsId>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>0.1.0-preview6</Version>
|
||||
<Version>0.1.0-preview7</Version>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
Loading…
Reference in New Issue