fix #1124 - return R_NilValue for null pointer objects
This fixes #1124 and returns R_NilValue for null pointer objects
This commit is contained in:
parent
7d6808daab
commit
0b97170f1d
2 changed files with 5 additions and 0 deletions
|
|
@ -260,6 +260,9 @@ AddOutputArgToReturn(int pos, SEXP value, const char *name, SEXP output)
|
|||
/* Create a new pointer object */
|
||||
SWIGRUNTIMEINLINE SEXP
|
||||
SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
|
||||
if (!ptr) {
|
||||
return R_NilValue;
|
||||
}
|
||||
SEXP rptr = R_MakeExternalPtr(ptr,
|
||||
R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue);
|
||||
SET_S4_OBJECT(rptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue