From 3fdecfdefacbce208095af2000455bc7cfda3edc Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Fri, 28 Jun 2019 15:40:02 -0700 Subject: [PATCH] gltf_viewer should not crash when there is no IBL. --- samples/gltf_viewer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {