OnGUI Error... Possible Unity Bug

Hey guys. Up until yesterday all my GUI code was working fine. However yesterday I updated to Unity 3.4.2f2.
Suddenly the gui code that uses a GUILayout started giving me the following error message

“ArgumentException: Getting control 0’s position in a group with only 0 controls when doing Repaint
Aborting”

So I stripped all my gui logic out and made it as basic as I possibly could. The code below still still give me the error mentioned on the “GUILayout.BeginArea()” line.

function OnGUI()
{
    DrawStoryScreen();
}

function DrawStoryScreen()
{
    GUILayout.BeginArea( Rect(0,0,300,300) );
    GUILayout.EndArea();
}

I understand that Unity calls the OnGUI function twice per frame and that all the GUI objects that are to be rendered need to remain consistent for those 2 calls. However as you can see… the posted code is about as consistent as it gets. Any idea why it isn’t working? Thanks in advance!

I know this thread is kind of old, but does anyone have an explanation as to why the hell this stupid error occurs? It’s really bugging me because my code works as it should in game (no issues and looks fine), but I’m getting the same error as the OP. My Error also occurs on a line where I use GUILayout.BeginArea.

Placed ‘yield WaitForEndOfFrame();’ in front of a boolean within a different function and it fixed it. I forgot OnGUI() is called more than once per frame facepalm

However, I still feel that this error is silly if the code works properly at run time anyway…

Could you give a snippet?