Skip to content
This repository was archived by the owner on May 9, 2025. It is now read-only.
This repository was archived by the owner on May 9, 2025. It is now read-only.

NullError when inspector tries to display a generic list of BaseReference #105

@TheRealDorcan

Description

@TheRealDorcan

Hello !

Small bug I fixed on my side: Basically, the inspector can't display a list of references because it generates a null error.
List<StringReference> listOfStringReferences;

(Arrays work fine)
StringReference[] arrayOfStringReferences;

The error:
NullReferenceException: Object reference not set to an instance of an object BaseReferenceHelper.GetValueType (System.Reflection.FieldInfo fieldInfo) (at Editor/BaseReferenceHelper.cs:31)

Here's my fix in BaseReferenceHelper.cs :

    public static Type GetValueType(FieldInfo fieldInfo)
    {
		 . . .
		if (referenceType.IsGenericType)
		{
			referenceType = referenceType.GetGenericArguments()[0];
		}
		else if (referenceType.IsArray)
		{
			referenceType = referenceType.GetElementType();
		}
		. . .
    }

Anyway, thanks a lot for all the quality hard work you put in this project! :)

Daniel

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions