Prevent crash when reloading renderable that only has labels and no data

Occurred when unchecking and rechecking the "Draw elements" property for example the "Eclipltic Sphere Labels"
This commit is contained in:
Emma Broman
2021-03-23 11:40:34 +01:00
parent 97c1066149
commit 0ea0e781da

View File

@@ -1492,6 +1492,11 @@ void RenderableBillboardsCloud::createDataSlice() {
ZoneScoped
_slicedData.clear();
if (_fullData.empty() || _nValuesPerAstronomicalObject == 0) {
return;
}
if (_hasColorMapFile) {
_slicedData.reserve(8 * (_fullData.size() / _nValuesPerAstronomicalObject));
}