From be4f9efc176d60e00de0ec1245a40b88567ebc4c Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 23 Oct 2008 23:51:30 +0000 Subject: [PATCH] don't yell if file is not open --- dtool/src/dtoolutil/pandaFileStreamBuf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolutil/pandaFileStreamBuf.cxx b/dtool/src/dtoolutil/pandaFileStreamBuf.cxx index 8bbdf79811..f192dac77a 100644 --- a/dtool/src/dtoolutil/pandaFileStreamBuf.cxx +++ b/dtool/src/dtoolutil/pandaFileStreamBuf.cxx @@ -448,7 +448,7 @@ underflow() { //////////////////////////////////////////////////////////////////// size_t PandaFileStreamBuf:: read_chars(char *start, size_t length) { - if (length == 0) { + if (length == 0 || !_is_open) { // Trivial no-op. return 0; } @@ -641,7 +641,7 @@ read_chars_raw(char *start, size_t length) { //////////////////////////////////////////////////////////////////// size_t PandaFileStreamBuf:: write_chars_raw(const char *start, size_t length) { - if (length == 0) { + if (length == 0 || !_is_open) { return 0; }