diff --git a/samples/gltf_viewer.cpp b/samples/gltf_viewer.cpp index b811549f7f..247ec9b3c6 100644 --- a/samples/gltf_viewer.cpp +++ b/samples/gltf_viewer.cpp @@ -207,7 +207,10 @@ int main(int argc, char** argv) { // Add the renderables to the scene. app.viewer->setAsset(app.asset, app.names, !app.actualSize); - app.viewer->setIndirectLight(FilamentApp::get().getIBL()->getIndirectLight()); + auto ibl = FilamentApp::get().getIBL(); + if (ibl) { + app.viewer->setIndirectLight(ibl->getIndirectLight()); + } }; auto setup = [&](Engine* engine, View* view, Scene* scene) {