From 4831d8069cb24b6a683c67ba55c78abec0316d8b Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Tue, 31 Oct 2017 14:34:18 -0400 Subject: possible None --- pyisda/credit_index.pyx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index 1dbd93c..663d6ed 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -40,7 +40,10 @@ cdef class CurveList: it = self.tickers.find(sc.ticker) if it == self.tickers.end(): self.tickers[sc.ticker] = i - self.curves.push_back(sc._thisptr) + if sc is not None: + self.curves.push_back(sc._thisptr) + else: + self.curves.push_back(shared_ptr[TCurve]()) self.weights.push_back(1.) i += 1 else: @@ -121,7 +124,10 @@ cdef class CurveList: it = self.tickers.find(sc.ticker) if it == self.tickers.end(): self.tickers[sc.ticker] = i - self.curves.push_back(sc._thisptr) + if sc is not None: + self.curves.push_back(sc._thisptr) + else: + self.curves.push_back(shared_ptr[TCurve]()) self.weights.push_back(1.) i += 1 else: -- cgit v1.2.3-70-g09d2