diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-09-18 20:28:35 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-09-18 20:28:35 +0000 |
commit | e6711b0d2edde3107e9a461850fbf317b5ec681b (patch) | |
tree | 88093d4f9c2ff448696bd5b0e2d315ba3295c055 /lib/server/makeprotocol.pl.in | |
parent | 6a9f012eb9044adada400a6ef613ed684abb7b34 (diff) |
Add check for trying to ReceiveStream when no stream available
Diffstat (limited to 'lib/server/makeprotocol.pl.in')
-rwxr-xr-x | lib/server/makeprotocol.pl.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/server/makeprotocol.pl.in b/lib/server/makeprotocol.pl.in index 14b0b7b4..65d1f3a9 100755 --- a/lib/server/makeprotocol.pl.in +++ b/lib/server/makeprotocol.pl.in @@ -887,6 +887,13 @@ private: public: virtual std::auto_ptr<IOStream> ReceiveStream() { + if(mStreamsToSend.empty()) + { + THROW_EXCEPTION_MESSAGE(CommonException, Internal, + "Tried to ReceiveStream when none was sent or " + "made available"); + } + std::auto_ptr<IOStream> apStream(mStreamsToSend.front()); mStreamsToSend.pop_front(); return apStream; |