Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed NullReferenceException #490

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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