]> git.seodisparate.com - jumpartifact.com_demo_0/commitdiff
Emit warning: ScreenStack tries to pop when empty
authorStephen Seo <seo.disparate@gmail.com>
Mon, 31 Jul 2023 11:45:16 +0000 (20:45 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Mon, 31 Jul 2023 11:45:16 +0000 (20:45 +0900)
src/screen.cc

index 8cd1bcc4bb006446405956bdf2f29b808e00eade..5d1bf4a8e51cb759b5ab9727e065446e64482167 100644 (file)
@@ -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.