Fixed InputActionDrawerBase not initializing the TreeView correctly to fix NullReferenceException when using Prefab Overrides window#1567
Merged
jamesmcgill merged 6 commits intodevelopfrom Sep 29, 2022
Conversation
- This change makes sure the TreeView.serializedObject matches the property. The value was null which was causing `OnGUI` to throw an exception. - The change to `UpdateSerializedObjectDirtyCount` was not necessary for this fix but it should protect against cases where the serializedObject becomes null for some reason. The `EditorUtility.GetDirtyCount` method returns 0 when the argument is null, so this seems like the appropriate thing to do.
vrdave-unity
approved these changes
Aug 1, 2022
ekcoh
approved these changes
Aug 18, 2022
Collaborator
|
@chris-massie I updated the changelog conflict and can merge this one as soon as CI is green. |
Collaborator
Author
|
@ekcoh I updated the changelog conflict again and the CI tests are all passing. This is ready to merge. |
andrew-oc
reviewed
Sep 26, 2022
|
|
||
| ### Changed | ||
| - Improved performance of HID descriptor parsing by moving json parsing to a simple custom predicitve parser instead of relying on Unity's json parsing. This should improve domain reload times when there are many HID devices connected to a machine. | ||
| - Fixed `ArgumentNullException` when opening the Prefab Overrides window and selecting a component with an `InputAction`. |
Contributor
There was a problem hiding this comment.
Shouldn't this should be under the [Unreleased] section?
Collaborator
There was a problem hiding this comment.
I'm in the middle of the release just now, so develop doesn't have the [Unreleased] section right now. That's probably why it's went here.
I will move this into [Unreleased] after I put it back and bump to v1.4.4 for the next release.
Collaborator
|
Thanks for the PR @chris-massie ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses a bug where the Prefab Overrides dropdown window would trigger a NullReferenceException when drawing a component that has an InputActionProperty with a singleton action (i.e. Use Reference unchecked).
Changes made
TreeView.serializedObjectmatches the property. The value was null which was causingOnGUIto throw an exception.UpdateSerializedObjectDirtyCountwas not necessary for this fix but it should protect against cases where the serializedObject becomes null for some unknown reason. TheEditorUtility.GetDirtyCountmethod returns 0 when the argument is null, so this seems like the appropriate thing to do.Notes
This was causing exceptions when looking at overrides of XRI components.
Checklist
Before review:
Changed,Fixed,Addedsections.([case %number%](https://issuetracker.unity3d.com/issues/...)).Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.