Browse Source

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

frogsoftware 1 năm trước cách đây
mục cha
commit
93d8520cd6

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

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