diff --git a/src/metadata.cc b/src/metadata.cc index c9060c81..3d8a6956 100644 --- a/src/metadata.cc +++ b/src/metadata.cc @@ -1,9 +1,14 @@ #include "metadata.hh" #include "toml.hpp" #include +#include std::optional< Metadata::result > Metadata::load( std::string_view filepath ) { + if ( !QFile::exists( QString::fromStdString( std::string{ filepath } ) ) ) { + return std::nullopt; + } + // by default, the optional will be initialized as std::nullopt Metadata::result result{}; toml::table tbl;