[Input] AssetPostprocessor - check file exists before attempting to read it (InputActionImporter)
Description
Added asset file existence check / early-out to AssetPostprocessor's CheckAndRenameJsonNameIfDifferent().
This was causing failures in some Unity internal package verification checks.
Changes made
Check that the asset file exists before attempting to read its contents.
Checklist
- [x] Changelog entry added.
- Explains the change in
Changed,Fixed,Addedsections. - For API change contains an example snippet and/or migration example.
- FogBugz ticket attached, example
([case %number%](https://issuetracker.unity3d.com/issues/...)). - FogBugz is marked as "Resolved" with next release version correctly set.
- Explains the change in
- [x] Tests added/changed, if applicable.
- [x] Docs for new/changed API's.
During merge:
- [ ] Commit message for squash-merge is prefixed with one of the list:
-
FIX: Fixed a minor issue when importing InputAction assets that could result in unexpected logging during internal package validation checks..
-
Not sure why the tvos test keeps failing.
Looking at the logs the tests themselves seem fine - something else is going on that's not test related.
Overall status: FAIL Reason(s): One or more non-test related errors or failures occurred. Detail(s): Message: A task was canceled. Stack trace: at Nito.AsyncEx.AsyncConditionVariable.WaitAndRetakeLockAsync(Task task, AsyncLock asyncLock) at Nito.AsyncEx.AsyncConditionVariable.WaitAndRetakeLockAsync(Task task, AsyncLock asyncLock) at Nito.AsyncEx.AsyncProducerConsumerQueue
1.TryDoDequeueAsync(CancellationToken cancellationToken, Boolean sync) at Nito.AsyncEx.AsyncProducerConsumerQueue1.DoDequeueAsync(CancellationToken cancellationToken, Boolean sync) at Unity.TestRunner.Common.PlayerConnection.PlayerConnectionBase.MessageAsyncEnumerator.MoveNextInternalAsync() in /home/bokken/build/output/unity/cds.test-platform/UnifiedTestRunner/source/Libraries/Unity.TestRunner.Common/SessionRunning/PlayerConnection/PlayerConnectionBase.cs:line 282 at Unity.UnityTestFramework.PluginBase.PlayerConnectionTestRunner.RunAsync(ProjectInfo projectInfo, CancellationToken cancellationToken) in /home/bokken/build/output/unity/unity/Tests/Unity.UnityTestFramework.PluginBase/PlayerConnectionTestRunner.cs:line 99 Total tests: 346 Failed test count: 0 Successful tests count: 346 Instabilities: 0 Not run tests count: 0 Details in: /Users/bokken/build/output/Unity-Technologies/InputSystem/build/test-results/TestReport.html
I don't see how the trivial change I made can have caused this.