[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:
Rolf Bjarne Kvinge 2022-12-12 17:14:29 +01:00 коммит произвёл GitHub
Родитель 3ff320805b
Коммит 0ba8d7e0e2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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;