diff --git a/stim/biomodels/network.h b/stim/biomodels/network.h index 7eb71c4..ac364ad 100644 --- a/stim/biomodels/network.h +++ b/stim/biomodels/network.h @@ -105,7 +105,12 @@ class network{ } length = length_sum; //store the total length - return radius_sum / length; //return the average radius of the fiber + + //if the total length is zero, store a radius of zero + if(length == 0) + return 0; + else + return radius_sum / length; //return the average radius of the fiber } std::string str(){ -- libgit2 0.21.4