From 433676226ced888f9ae8eb3f08aacf54dcc7209d Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 17 Dec 2015 16:45:56 -0500 Subject: [PATCH] byteBuffer throw invalid_argument when ctor w/ NULL --- src/misc/byteBuffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/byteBuffer.h b/src/misc/byteBuffer.h index 266eee5..945c80b 100644 --- a/src/misc/byteBuffer.h +++ b/src/misc/byteBuffer.h @@ -237,7 +237,7 @@ public: /** * Constructor for wrapping an existing buffer. * Given buffer will not be released by the ByteBuffer instance. - * @param buffer Existing buffer. + * @param buffer Existing buffer. May not be NULL. * @param size The number of bytes. * @param byteOrder The byte order. * Must be one of EPICS_BYTE_ORDER,EPICS_ENDIAN_LITTLE,EPICS_ENDIAN_BIG. @@ -249,7 +249,7 @@ public: _wrapped(true) { if(!_buffer) - throw std::bad_alloc(); + throw std::invalid_argument("ByteBuffer can't be constructed with NULL"); clear(); } /**