The object of type 'CanvasRenderer' has been destroyed but you are still trying to access it

hello.
i’m getting this error after i deleting a UI on my game… since i don’t need it anymore i would like to destroy it but game freexze after deleting it… any idea of why i’m getting this error?

“The object of type ‘CanvasRenderer’ has been destroyed but you are still trying to access it.”

Your accessing it from a script, so when you delete it it causes the error.