summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyisda/credit_index.pyx2
1 files changed, 2 insertions, 0 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx
index 2f90b01..0951f35 100644
--- a/pyisda/credit_index.pyx
+++ b/pyisda/credit_index.pyx
@@ -862,6 +862,8 @@ cdef double pv(const vector[shared_ptr[TCurve]]& curves,
size_t i = 0
double* recovery_rate
+ if curves.size() == 0:
+ return nan("")
if epsilon == 0.:
with parallel():
fl_pv = 0.