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

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


Git commit 9ff8e2fa96bb6e42c58a86160ceb89e3c79f7bde by Thomas Friedrichsmeier.
Committed on 17/04/2018 at 09:17.
Pushed by tfry into branch 'kde4'.

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/9ff8e2fa96bb6e42c58a86160ceb89e3c79f7bde

diff --git a/ChangeLog b/ChangeLog
index 1de03c7f..ca077c3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 --- Version 0.6.5a - UNRELEASED
+- Do not throw an error on objects that return non-numeric/non-scalar dim()
 - Fix crash with R 3.5.x due to use to STRING_PTR
 - EXPERIMENTAL: Fix NAs introduced by editing data containing characters that cannot be encoded in the system locale
 - Fixed: Preview boxes followed by a <stretch/> element would not work under some circumstances
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