summaryrefslogtreecommitdiff
path: root/sci_gateway
diff options
context:
space:
mode:
Diffstat (limited to 'sci_gateway')
-rw-r--r--sci_gateway/cpp/sci_octave.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp
index 1ccda51..817c184 100644
--- a/sci_gateway/cpp/sci_octave.cpp
+++ b/sci_gateway/cpp/sci_octave.cpp
@@ -159,7 +159,10 @@ extern "C"
scilabVar struct_out;
int dims = 0;
- dims = scilab_getFields(env, in[i], &keys); // Retrieving Struct Keys
+ // call getfields only when struct is not empty else getfields will crash
+ if(scilab_isEmpty(env, in[i]) != 1){
+ dims = scilab_getFields(env, in[i], &keys); // Retrieving Struct Keys
+ }
ins[i].n_in_struct_len = dims;
//std::cout<<dims<<std::endl;