Skip to content

Commit b175843

Browse files
committed
Fixed bug that prevented getting the value of a RAW attribute in a DbObject that is null
1 parent e4d7044 commit b175843

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

doc/src/release_notes.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ Thin Mode Changes
3131
in embedded quotes and in JSON syntax.
3232
`Issue #1605 <https://github.com/oracle/node-oracledb/issues/1605>`__.
3333

34-
#) Corrected bug that caused cursors to be leaked when calling
35-
Connection.getStatementInfo().
34+
#) Fixed bug that caused cursors to be leaked when calling
35+
:meth:`connection.getStatementInfo()`.
3636

3737
#) Fixed bug that caused an exception to be thrown unnecessarily when a connection was closed.
3838
`Issue #1604 <https://github.com/oracle/node-oracledb/issues/1604>`__.
3939

40+
#) Fixed bug that prevented getting the value of a RAW attribute on a DbObject
41+
which is null.
42+
4043
Thick Mode Changes
4144
++++++++++++++++++
4245

lib/thin/dbObject.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ class ThinDbObjectImpl extends DbObjectImpl {
367367
case types.DB_TYPE_NCHAR:
368368
return buf.readStr(constants.CSFRM_NCHAR);
369369
case types.DB_TYPE_RAW:
370-
return Buffer.from(buf.readBytesWithLength());
370+
value = buf.readBytesWithLength();
371+
if (value !== null)
372+
value = Buffer.from(value);
373+
return value;
371374
case types.DB_TYPE_BINARY_DOUBLE:
372375
return buf.readBinaryDouble();
373376
case types.DB_TYPE_BINARY_FLOAT:

0 commit comments

Comments
 (0)