Unity Issue Tracker - "NullReferenceException" and "Package manager extension failed with error" are thrown when a Sample in package.json is missing the "path" or "displayName" field
Fixed
UUM-137672
"NullReferenceException" and "Package manager extension failed with error" are thrown when a Sample in package.json is missing the "path" or "displayName" field
Go to Window > Package Management > Package Manager
Click on the "+" icon and select "Create Package..."
Create a package with any name and Locate it
Open the "package.json" of the created package
Add a sample array but intentionally omit the displayName or path field, for example:
"samples":[
{
"path": "Samples/Example"
}
],
Save and close package.json
Observe the Console
Actual results: "NullReferenceException: Object reference not set to an instance of an object" error and "[Package Manager Window] Package manager extension failed with error: System.NullReferenceException: Object reference not set to an instance of an object" when opening Package Manager
Expected results: The path and displayName fields are validated, providing a clear and user-friendly error or warning message instead of throwing a NullReferenceException
Reproducible with versions: 6000.3.12f1, 6000.4.1f1, 6000.5.0b1, 6000.6.0a1
Tested on (OS): macOS 26.3 (M1)
Notes:
In earlier versions (6000.4 and below), if a user provided a displayName but left the path empty, the UI would load it. However, clicking "Import" would default to the package root and import the entire package into Assets/Samples, causing massive GUID and Assembly Definition conflicts in the Console
Prioritise and Follow this issue
Have a workaround or additional info about this issue?