diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2020-02-18 16:21:23 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2020-02-18 16:21:23 -0500 |
| commit | d64698ef39af7d865b9aed970fd67036a1908b68 (patch) | |
| tree | f4ea30200e1c9dc639582967dd12194fb1b91575 | |
| parent | f4173c0e8a6b925dc75a9890b56e1e9a146964e9 (diff) | |
| download | pyisda-d64698ef39af7d865b9aed970fd67036a1908b68.tar.gz | |
prevent segfault
| -rw-r--r-- | pyisda/credit_index.pyx | 6 |
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 |
