From 00795982c9a99dcad69b33f75d38328165bd5df8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 26 Mar 2013 22:15:19 +0200 Subject: [PATCH] Return null instead of throwing if a file is not found in sources The primary use case for open_from_sources is for creator functions to open raw files. This change makes it easier to gracefully skip a non- existent file and carry on with other ways of loading the item. --- source/collection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/collection.cpp b/source/collection.cpp index 984fb74..aa607bd 100644 --- a/source/collection.cpp +++ b/source/collection.cpp @@ -97,7 +97,7 @@ IO::Seekable *Collection::open_from_sources(const string &name) if(IO::Seekable *io = (*i)->open(name)) return io; - throw IO::file_not_found(name); + return 0; } void Collection::gather_names_from_sources(list &names, const CollectionItemTypeBase &type) const -- 2.43.0