How to solve the problem of "You are pushing more GUIClips than you are popping"

I am getting the error message “GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)”

ScrollPosition =  EditorGUILayout.BeginScrollView(ScrollPosition, false, false);

                        foreach (Object ob in ObjectArray)
                        {
                        //Draw GUI stuff
                      }

 EditorGUILayout.EndScrollView();

I get no errors when i remove the info for the scroll bars.

Is there re another way to draw scroll bars once the content in the window overflows ?

if not then how do i get around this problem?

Traditionally, this sort of error is when you have more Begins than Ends. There might be a return which is cutting off an EndScrollView. Or it’s hidden in some if-else logic, where a condition calls BeginScrollView, but then changes so the identical if for EndScrollView isn’t firing.