From 57ea9ae04aa3deab8e12a53fddc51baec1edb372 Mon Sep 17 00:00:00 2001
From: Johannes Hofmann <Johannes.Hofmann@gmx.de>
Date: Sun, 9 Mar 2014 20:30:00 +0100
Subject: don't crash if screen dump fails

---
 src/ScreenDump.cxx | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src')

diff --git a/src/ScreenDump.cxx b/src/ScreenDump.cxx
index c0f038e..f331a76 100644
--- a/src/ScreenDump.cxx
+++ b/src/ScreenDump.cxx
@@ -42,6 +42,9 @@ ScreenDump::~ScreenDump() {
 
 int
 ScreenDump::save(OutputImage *out) {
+	if (!rgb)
+		return 1;
+
 	out->init(w, h);
 
 	for (int y = 0; y < h; y++) {
-- 
cgit v1.2.3