summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2017-10-31 14:34:18 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2017-10-31 14:38:52 -0400
commit4831d8069cb24b6a683c67ba55c78abec0316d8b (patch)
tree806edf440842c01e627765591c26075269306c03
parent64422762f32ea4882ad7c6861fdf02877abf65f6 (diff)
downloadpyisda-4831d8069cb24b6a683c67ba55c78abec0316d8b.tar.gz
possible None
-rw-r--r--pyisda/credit_index.pyx10
1 files 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: