Skip to content

Commit 24bce5e

Browse files
committed
Refine NamesProxy setter to set only non-NULL values
1 parent a03c2a2 commit 24bce5e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2026-04-03 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Rcpp/proxy/NamesProxy.h (set): Only set non-null values
4+
15
2026-04-01 Mattias Ellert <mattias.ellert@physics.uu.se>
26

37
* inst/discovery/cxx0x.R: Set execute permissions for script

inst/include/Rcpp/proxy/NamesProxy.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (C) 2013 - 2025 Romain François
2-
// Copyright (C) 2026 Romain François and Iñaki Ucar
2+
// Copyright (C) 2026 Romain François, Iñaki Ucar and Dirk Eddelbuettel
33
//
44
// This file is part of Rcpp.
55
//
@@ -48,7 +48,8 @@ class NamesProxyPolicy{
4848
}
4949

5050
void set(SEXP x) {
51-
Rf_namesgets(parent, Shield<SEXP>(x));
51+
if (!Rf_isNull(x))
52+
Rf_namesgets(parent, Shield<SEXP>(x));
5253
}
5354

5455
} ;

0 commit comments

Comments
 (0)