From: Stephen Seo Date: Mon, 31 Jul 2023 11:45:16 +0000 (+0900) Subject: Emit warning: ScreenStack tries to pop when empty X-Git-Url: https://git.seodisparate.com/stephenseo/js/darkmode.js?a=commitdiff_plain;h=a0dbf2b1728217c42906b1df6ee996f0d2540081;p=jumpartifact.com_demo_0 Emit warning: ScreenStack tries to pop when empty --- 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.