diff --git a/components/debug/gldebug.cpp b/components/debug/gldebug.cpp index 29036af162..482755b761 100644 --- a/components/debug/gldebug.cpp +++ b/components/debug/gldebug.cpp @@ -239,7 +239,7 @@ namespace Debug group->push(state); lastAppliedStack.push_back(group); } - if (!(lastAppliedStack.back() == this)) + if (lastAppliedStack.empty() || !(lastAppliedStack.back() == this)) { push(state); lastAppliedStack.push_back(this);