소스 검색

Fixed LicenseUtils.LicenseMap() when Entities do not have a ILicense<> interface

frogsoftware 1 년 전
부모
커밋
93d8520cd6
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      InABox.Core/Licensing/LicenseUtils.cs

+ 2 - 1
InABox.Core/Licensing/LicenseUtils.cs

@@ -245,7 +245,8 @@ namespace InABox.Core
             {
                 var lic = entity.GetInterfaces()
                     .FirstOrDefault(x => x.IsConstructedGenericType && x.GetGenericTypeDefinition() == typeof(ILicense<>));
-                result[entity] = lic?.GenericTypeArguments.FirstOrDefault();
+                if (lic != null)
+                    result[entity] = lic.GenericTypeArguments.FirstOrDefault();
             }
 
             return result;