[tests] Fix potential NullReferenceException in cecil-tests. (#16998)
Fixes this compiler warning: tests/cecil-tests/MarshalAsTest.cs(91,8): warning CS8602: Dereference of a possibly null reference.
This commit is contained in:
Родитель
3ff320805b
Коммит
0ba8d7e0e2
|
@ -88,6 +88,9 @@ namespace Cecil.Tests {
|
|||
if (type is null && tr.FullName == "System.Runtime.InteropServices.NFloat")
|
||||
return true;
|
||||
|
||||
if (type is null)
|
||||
throw new Exception ($"Unable to resolve {tr.FullName}");
|
||||
|
||||
if (type.IsEnum)
|
||||
return true;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче