summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: