- KeldorKatarn
- Posts: 193
- Joined:
NullReferenceException whenever XAML is reloaded
I have a minor issue in Unity.
Whenever I make changes to a XAML and then go back to the Unity Editor and it reloads it, I can the "save asset" dialog and when I confirm I get this in the console:
This happens every single time a XAML is reloaded
Edit: Just to be clear this doesn't cause any further issues than the logged exception. The xaml is reloaded perfectly fine. It seems Noesis is trying to open some sort of editor window and not finding it?
Whenever I make changes to a XAML and then go back to the Unity Editor and it reloads it, I can the "save asset" dialog and when I confirm I get this in the console:
Code: Select all
[Exception] NullReferenceException: Object reference not set to an instance of an object
ContainerWindow.NotDockedWindowID() at <d3ff43e972b043d1b3f49905ec5da738>:0
ContainerWindow.Load() at <d3ff43e972b043d1b3f49905ec5da738>:0
ContainerWindow.Show() at <d3ff43e972b043d1b3f49905ec5da738>:0
EditorWindow.ShowWithMode() at <d3ff43e972b043d1b3f49905ec5da738>:0
EditorWindow.ShowModal() at <d3ff43e972b043d1b3f49905ec5da738>:0
AssetSaveDialog.ShowWindow() at <d3ff43e972b043d1b3f49905ec5da738>:0
AssetModificationProcessorInternal.OnWillSaveAssets() at <d3ff43e972b043d1b3f49905ec5da738>:0
NoesisPostprocessor.ImportXaml() at /NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:369
368: EditorUtility.SetDirty(xaml);
-->369: AssetDatabase.SaveAssets();
370: Log("? ImportXaml");
371: }
NoesisPostprocessor.ImportXaml() at /NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:316
314: {
315: bool changed;
-->316: return ImportXaml(filename, reimport, reload, out changed);
317: }
NoesisPostprocessor.ImportAssets() at /NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:79
77: else if (IsXaml(asset))
78: {
-->79: ImportXaml(asset, true, reload);
80: }
81: }
<>c__DisplayClass4_1.<OnPostprocessAllAssets>b__0() at /NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:111
110: string[] assets = importedAssets.Concat(movedAssets).ToArray();
-->111: ImportAssets(assets, NoesisSettings.Get().hotReloading, (progress, asset) =>
112: EditorUtility.DisplayProgressBar("Import XAMLs", asset, progress));
113: EditorUtility.ClearProgressBar();
Edit: Just to be clear this doesn't cause any further issues than the logged exception. The xaml is reloaded perfectly fine. It seems Noesis is trying to open some sort of editor window and not finding it?
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: NullReferenceException whenever XAML is reloaded
From the callstack I will say is the AssetDatabase.SaveAssets() call and Unity trying to open a modal window which is throwing the exception.
I don't know if we can do anything about it, maybe delay the call to SaveAssets. We'll try to reproduce it and see if we can avoid it, thanks for pointing this out.
I don't know if we can do anything about it, maybe delay the call to SaveAssets. We'll try to reproduce it and see if we can avoid it, thanks for pointing this out.
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: NullReferenceException whenever XAML is reloaded
One question, is Unity playing when you get that error, or is it always happening?
- KeldorKatarn
- Posts: 193
- Joined:
Re: NullReferenceException whenever XAML is reloaded
It is always happening. And yes once I edited a XAML in Visual Studio and come back to Unity, Unity opens the "save asset" dialog. once I click save, the exception is thrown. Not sure what Unity is trying to open there.
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: NullReferenceException whenever XAML is reloaded
I don't get the chance to see any dialog poping and I don't remember ever seeing a dialog that I had to click "Save" for saving an asset.
Which Unity version are you using, so we can try the same thing?
Which Unity version are you using, so we can try the same thing?
- KeldorKatarn
- Posts: 193
- Joined:
Re: NullReferenceException whenever XAML is reloaded
Unity 2019.4.9f1 (64-bit) at the moment.
This is what I get: As soon as I hit "Save all", the exception is thrown.
This is what I get: As soon as I hit "Save all", the exception is thrown.
- KeldorKatarn
- Posts: 193
- Joined:
Re: NullReferenceException whenever XAML is reloaded
Found it. Apprently a Unity bug in this version:
https://forum.unity.com/threads/2019-3- ... on.891469/
Deactivating that verify option should also stop displaying that dialog for me (which is incredibly annoying when Noesis initially loads all its included XAMLs because that dialog opens for every single XAML asset individually.... sigh. Sometimes Unity devs do weird things.
https://forum.unity.com/threads/2019-3- ... on.891469/
Deactivating that verify option should also stop displaying that dialog for me (which is incredibly annoying when Noesis initially loads all its included XAMLs because that dialog opens for every single XAML asset individually.... sigh. Sometimes Unity devs do weird things.
Re: NullReferenceException whenever XAML is reloaded
Thanks for this. The message is in fact disturbing
"Unity is about to save the following modified files. Unsaved changes will be lost"
Glad to know it is a bug in Unity.
"Unity is about to save the following modified files. Unsaved changes will be lost"
Glad to know it is a bug in Unity.
- KeldorKatarn
- Posts: 193
- Joined:
Re: NullReferenceException whenever XAML is reloaded
I'm actually assuming it's fixed in later versions. I had to pause my project for a while and I haven't upgraded to the 2020 versions yet. I'll confirm once I do that this is no longer an issue.
Who is online
Users browsing this forum: Google [Bot] and 69 guests