diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 8ccaf2d100..d39e55b22b 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -688,7 +689,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) RenderableStars::~RenderableStars() {} bool RenderableStars::isReady() const { - return _program != nullptr; + return _program && _pointSpreadFunctionTexture; } void RenderableStars::initializeGL() { @@ -1214,7 +1215,9 @@ void RenderableStars::update(const UpdateData&) { if (_pointSpreadFunctionTextureIsDirty) { LDEBUG("Reloading Point Spread Function texture"); _pointSpreadFunctionTexture = nullptr; - if (!_pointSpreadFunctionTexturePath.value().empty()) { + if (!_pointSpreadFunctionTexturePath.value().empty() && + std::filesystem::exists(_pointSpreadFunctionTexturePath.value())) + { _pointSpreadFunctionTexture = ghoul::io::TextureReader::ref().loadTexture( absPath(_pointSpreadFunctionTexturePath) );