View Revisions: Issue #1668

Summary 0001668: NoesisPostProcessor.ImportXaml NullReferneceException After Font Deletion
Revision 2020-04-27 12:26 by jsantos
Description This code fails after a font is deleted:

            foreach (var dep in xaml.fonts)
            {
                if (File.Exists(dep.source))
                {
                    ImportFont(dep.source, false, false);
                }
            }

NullReferenceException: Object reference not set to an instance of an object
NoesisPostprocessor.ImportXaml (System.String filename, System.Boolean reimport, System.Boolean reload, System.Boolean& changed) (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:360)
NoesisPostprocessor.ImportXaml (System.String filename, System.Boolean reimport, System.Boolean reload, System.Boolean& changed) (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:353)
NoesisPostprocessor.ImportAssets (System.String[] assets, System.Boolean reload, NoesisPostprocessor+UpdateProgress d) (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:55)
NoesisPostprocessor+<>c__DisplayClass4_1.<OnPostprocessAllAssets>b__0 () (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:110)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvoke (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <bf679006b1b84db2a5a44842ef13dc36>:0)
Revision 2020-04-25 00:07 by stonstad
Description This code fails after a font is deleted:

            foreach (var dep in xaml.fonts)
            {
                if (File.Exists(dep.source))
                {
                    ImportFont(dep.source, false, false);
                }
            }

NullReferenceException: Object reference not set to an instance of an object
NoesisPostprocessor.ImportXaml (System.String filename, System.Boolean reimport, System.Boolean reload, System.Boolean& changed) (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:360)
NoesisPostprocessor.ImportXaml (System.String filename, System.Boolean reimport, System.Boolean reload, System.Boolean& changed) (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:353)
NoesisPostprocessor.ImportAssets (System.String[] assets, System.Boolean reload, NoesisPostprocessor+UpdateProgress d) (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:55)
NoesisPostprocessor+<>c__DisplayClass4_1.<OnPostprocessAllAssets>b__0 () (at Assets/NoesisGUI/Plugins/Editor/NoesisPostprocessor.cs:110)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvoke (System.Object[] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <bf679006b1b84db2a5a44842ef13dc36>:0)