From 5f334d383904410c9cc222018c5497ea9c36ccde Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 21 Jul 2021 22:53:12 +0100 Subject: [PATCH] ModelRegistry: Special case empty file names Related to ticket: https://sourceforge.net/p/flightgear/codetickets/2609/ --- simgear/scene/model/ModelRegistry.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simgear/scene/model/ModelRegistry.cxx b/simgear/scene/model/ModelRegistry.cxx index 12f768d7..f6bcee90 100644 --- a/simgear/scene/model/ModelRegistry.cxx +++ b/simgear/scene/model/ModelRegistry.cxx @@ -733,6 +733,10 @@ ReaderWriter::ReadResult ModelRegistry::readNode(const string& fileName, const Options* opt) { + if (fileName.empty()) { + return osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED; + } + // propogate error context from the caller simgear::ErrorReportContext ec; auto sgopt = dynamic_cast(opt);