Core/Spline: Fix crash

Fix crash when calling MoveSpline::ToString() on an empty spline
This commit is contained in:
jackpoz
2019-07-21 16:21:43 +02:00
parent c4c739fea5
commit 2bac44c7d0

View File

@@ -201,7 +201,12 @@ public:
}
/** Returns length of the whole spline. */
length_type length() const { return lengths[index_hi];}
length_type length() const
{
if (lengths.empty())
return 0;
return lengths[index_hi];
}
/** Returns length between given nodes. */
length_type length(index_type first, index_type last) const { return lengths[last]-lengths[first];}
length_type length(index_type Idx) const { return lengths[Idx];}