From cf8f03564b5118b257d081037f0e7c5241ee6350 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 19 Feb 2005 17:02:19 +0000 Subject: [PATCH] Don't crash when we have no screens. --- bigscreen/ccbs_bigscreen.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index dfb025f..fbbc0aa 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -51,11 +51,13 @@ void main_loop(pqxx::connection &conn) memset(framebuf, 0, 800*600*4); - if (screens[0]->check_invalidated()) { - screens[0]->draw(screenbuf); + if (screens.size() > 0) { + if (screens[0]->check_invalidated()) { + screens[0]->draw(screenbuf); + } + + memcpy(framebuf, screenbuf, 800*600*4); } - - memcpy(framebuf, screenbuf, 800*600*4); ptc_update(framebuf); conn.await_notification(0, 50000); -- 2.39.5