mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01:00
[sequence] Fixed crash due to undefined sequence
Change-Id: Ie67ff4aa9a53eb8b04535e3b61737e11c9049316
This commit is contained in:
committed by
Émilie Feral
parent
b8544e3708
commit
51002066e9
@@ -30,12 +30,14 @@ const Expression CacheContext<T>::expressionForSymbolAbstract(const Poincare::Sy
|
||||
return Float<T>::Builder(m_values[index][1]);
|
||||
}
|
||||
Ion::Storage::Record record = m_sequenceContext->sequenceStore()->recordAtIndex(index);
|
||||
Sequence * seq = m_sequenceContext->sequenceStore()->modelForRecord(record);
|
||||
rank.replaceSymbolWithExpression(Symbol::Builder(UCodePointUnknown), Float<T>::Builder(m_nValue));
|
||||
T n = PoincareHelpers::ApproximateToScalar<T>(rank, this);
|
||||
// In case the rank is not int or sequence referenced is not defined, return NAN
|
||||
if (std::floor(n) == n && seq->fullName() != nullptr) {
|
||||
return Float<T>::Builder(seq->valueAtRank<T>(n, m_sequenceContext));
|
||||
if (!record.isNull()) {
|
||||
Sequence * seq = m_sequenceContext->sequenceStore()->modelForRecord(record);
|
||||
rank.replaceSymbolWithExpression(Symbol::Builder(UCodePointUnknown), Float<T>::Builder(m_nValue));
|
||||
T n = PoincareHelpers::ApproximateToScalar<T>(rank, this);
|
||||
// In case the rank is not int or sequence referenced is not defined, return NAN
|
||||
if (std::floor(n) == n && seq->fullName() != nullptr) {
|
||||
return Float<T>::Builder(seq->valueAtRank<T>(n, m_sequenceContext));
|
||||
}
|
||||
} else {
|
||||
return Float<T>::Builder(NAN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user