summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2020-02-18 16:21:23 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2020-02-18 16:21:23 -0500
commitd64698ef39af7d865b9aed970fd67036a1908b68 (patch)
treef4ea30200e1c9dc639582967dd12194fb1b91575
parentf4173c0e8a6b925dc75a9890b56e1e9a146964e9 (diff)
downloadpyisda-d64698ef39af7d865b9aed970fd67036a1908b68.tar.gz
prevent segfault
-rw-r--r--pyisda/credit_index.pyx6
1 files changed, 3 insertions, 3 deletions
diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx
index dbb9a6d..16e83dc 100644
--- a/pyisda/credit_index.pyx
+++ b/pyisda/credit_index.pyx
@@ -57,12 +57,12 @@ cdef class CurveList:
size_t n = len(curves)
double w
- w, sc = curves[0]
-
if value_date is not None:
self.base_date = pydate_to_TDate(value_date)
else:
- self.base_date = sc._thisptr.get().fBaseDate
+ if len(curves) >= 1:
+ w, sc = curves[0]
+ self.base_date = sc._thisptr.get().fBaseDate
i = 0
cdef int n_skipped = 0