thisisnic commented on code in PR #49653:
URL: https://github.com/apache/arrow/pull/49653#discussion_r3035861739


##########
r/src/arrow_cpp11.h:
##########
@@ -208,14 +208,20 @@ Pointer r6_to_pointer(SEXP self) {
     cpp11::stop("Invalid R object for %s, must be an ArrowObject", 
type_name.c_str());
   }
 
-#if R_VERSION >= R_Version(4, 5, 0)
-  SEXP xp = R_getVarEx(arrow::r::symbols::xp, self, FALSE, R_UnboundValue);
+#if R_VERSION >= R_Version(4, 6, 0)
+  if (!R_existsVarInFrame(self, arrow::r::symbols::xp)) {
+    cpp11::stop("Invalid: self$`.:xp:.` is NULL");
+  }
+  SEXP xp = R_getVar(arrow::r::symbols::xp, self, FALSE);
+  if (xp == R_NilValue) {
+    cpp11::stop("Invalid: self$`.:xp:.` is NULL");
+  }
 #else
   SEXP xp = Rf_findVarInFrame(self, arrow::r::symbols::xp);
-#endif
   if (xp == R_UnboundValue || xp == R_NilValue) {
     cpp11::stop("Invalid: self$`.:xp:.` is NULL");
   }
+#endif

Review Comment:
   Yup!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to