"MissingReferenceException: The object of type 'TextureImporter' has been destroyed but you are still trying to access it."
i tried importing an image and got this in the console: MissingReferenceException: The object of type 'TextureImporter' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEditor.TextureImporter.GetWidthAndHeight (System.Int32& width, System.Int32& height) (at :0) UnityEditor.U2D.Sprites.TextureImporterDataProvider.GetWidthAndHeight (System.Int32& width, System.Int32& height) (at C:/Program Files/Unity/Hub/Editor/2019.4.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.sprite/Editor/SpriteEditorModule/TextureImporterDataProvider.cs:121) UnityEditor.U2D.Sprites.SpriteTextureDataTransfer.GetTextureActualWidthAndHeight (System.Int32& width, System.Int32& height) (at C:/Program Files/Unity/Hub/Editor/2019.4.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.sprite/Editor/SpriteEditorModule/TextureImporterDataProviderImplementation.cs:415) UnityEditor.U2D.Animation.SkinningModule.SetupSpriteEditor (System.Boolean setPreviewTexture) (at Library/PackageCache/com.unity.2d.animation@3.2.6/Editor/SkinningModule/SkinningModule.cs:209) UnityEditor.U2D.Animation.SkinningModule.UndoRedoPerformed () (at Library/PackageCache/com.unity.2d.animation@3.2.6/Editor/SkinningModule/SkinningModule.cs:370) UnityEditor.Undo.Internal_CallUndoRedoPerformed () (at :0)
Your answer
![](https://koobas.hobune.stream/wayback/20220613022432im_/https://answers.unity.com/themes/thub/images/avi.jpg)