Skip to content

Commit

Permalink
Fixed NullReferenceException
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers committed Jul 28, 2024
1 parent c1483fc commit facaeff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/net/JNetReflector/InternalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,8 @@ static void GetGenerics(this Java.Lang.Reflect.Type[] entries, IList<string> gen
static string GetBound(this Java.Lang.Reflect.Type bound, bool usedInGenerics, bool camel, string parentTypeName)
{
var bClass = bound.TypeName.JVMClass();
if (bClass.IsClassToAvoid()) return string.Empty;
string result;
if (bClass != null && bClass.IsClassToAvoid()) return string.Empty;
string result = string.Empty;
if (bClass != null && bClass.IsInterface())
{
result = bClass.JVMInterfaceName(new List<KeyValuePair<string, string>>(), usedInGenerics, true) + AllPackageClasses.WHERE_CLAUSE_NEW; // the new constraint means the type shall be a class implementing the interface
Expand All @@ -750,7 +750,10 @@ static string GetBound(this Java.Lang.Reflect.Type bound, bool usedInGenerics, b
var cName = bound.TypeName;
cName = cName.Contains('<') ? cName.Substring(0, cName.IndexOf('<')) : cName;
bClass = cName.JVMClass();
result = bClass.ToFullQualifiedClassName(usedInGenerics, camel, parentTypeName);
if (bClass != null && !bClass.IsClassToAvoid())
{
result = bClass.ToFullQualifiedClassName(usedInGenerics, camel, parentTypeName);
}
}
else if (bound.IsParameterizedTypeWithoutGenerics())
{
Expand Down

0 comments on commit facaeff

Please sign in to comment.