Missing Reference Exception @ GuiSkin...Gui Button

Hello Unityrs, I have the following function which is called by the OnGUI one. The Compiler returns me this message: "MissingReferenceException: The object of type 'Texture2D' 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." in correspondance of the IF, but I can't figure out...what does that mean.

function GlobalChatWindow (id : int) {

var closeButtonStyle = GUI.skin.GetStyle("close_button");

if (GUI.Button(Rect (4, 4, closeButtonStyle.normal.background.width, closeButtonStyle.normal.background.height), "", "close_button")) { CloseChatWindow(); } ...

Any help!? :) Thanks !

It sounds like your skin doesn’t have a “close_button” style. This causes it to return a null pointer, which gives you a NullReferenceException when you try to access it.