From a0dbf2b1728217c42906b1df6ee996f0d2540081 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Mon, 31 Jul 2023 20:45:16 +0900 Subject: [PATCH] Emit warning: ScreenStack tries to pop when empty --- src/screen.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/screen.cc b/src/screen.cc index 8cd1bcc..5d1bf4a 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -68,6 +68,11 @@ void ScreenStack::handle_pending_actions() { if (!stack.empty()) { stack.pop_back(); } +#ifndef NDEBUG + else { + std::cerr << "WARNING: Tried to pop screen when stack was empty!\n"; + } +#endif // NDEBUG break; case Action::NOP: // Intentionally left blank.