When using texture brush, press ctrl + z undo throw errors:
Exception: Float array size wrong (layers should be 4)
UnityEngine.TerrainData.SetAlphamaps (System.Int32 x, System.Int32 y, System.Single[,,] map) (at :0)
MapMagic.Brush.Undo.TerrainUndoData.Write (UnityEngine.Terrain terrain) (at Assets/MapMagic/Brush/Core/UndoBac.cs:122)
MapMagic.Brush.Undo.Undo.Perform () (at Assets/MapMagic/Brush/Core/UndoBac.cs:260)
MapMagic.Brush.Undo.Undo.OnUndoRedoPerformed () (at Assets/MapMagic/Brush/Core/UndoBac.cs:188)
or
MissingReferenceException: The object of type 'Terrain' 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.
MapMagic.Brush.Undo.TerrainUndoData.Write (UnityEngine.Terrain terrain) (at Assets/MapMagic/Brush/Core/UndoBac.cs:100)
MapMagic.Brush.Undo.Undo.Perform () (at Assets/MapMagic/Brush/Core/UndoBac.cs:260)
MapMagic.Brush.Undo.Undo.OnUndoRedoPerformed () (at Assets/MapMagic/Brush/Core/UndoBac.cs:188)
UnityEditor.Undo.Internal_CallUndoRedoPerformed () (at :0)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()