[rkward] /: Do not get confused by non-numeric dim().

Thomas Friedrichsmeier null at kde.org
Tue Apr 17 09:16:15 UTC 2018


Git commit c97ab062227cd414578bc67d93832ca8e957dcda by Thomas Friedrichsmeier.
Committed on 17/04/2018 at 09:15.
Pushed by tfry into branch 'master'.

Do not get confused by non-numeric dim().

CCBUG: 384921

M  +1    -0    ChangeLog
M  +1    -1    rkward/rbackend/rkstructuregetter.cpp

https://commits.kde.org/rkward/c97ab062227cd414578bc67d93832ca8e957dcda

diff --git a/ChangeLog b/ChangeLog
index 9d394cc4..6a1b3b9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 --- Version 0.7.1 - UNRELEASED
+- Do not throw an error on objects that return non-numeric/non-scalar dim()
 
 --- Version 0.7.0b - Apr-16-2018
 - Fix failure to install translations
diff --git a/rkward/rbackend/rkstructuregetter.cpp b/rkward/rbackend/rkstructuregetter.cpp
index ba753475..dada64ec 100644
--- a/rkward/rbackend/rkstructuregetter.cpp
+++ b/rkward/rbackend/rkstructuregetter.cpp
@@ -281,7 +281,7 @@ void RKStructureGetter::getStructureWorker (SEXP val, const QString &name, int a
 	// get dims
 	RData::IntStorage dims;
 	SEXP dims_s = RKRSupport::callSimpleFun (dims_fun, value, baseenv);
-	if (!Rf_isNull (dims_s)) {
+	if (Rf_isNumeric (dims_s)) {
 		dims = RKRSupport::SEXPToIntArray (dims_s);
 	} else {
 		unsigned int len = Rf_length (value);



More information about the rkward-tracker mailing list