Преглед изворни кода

fix: don't try to read non-json files as json

Sam Jaffe пре 1 година
родитељ
комит
9d11ce65fc
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      include/engine/universe.tpp

+ 1 - 0
include/engine/universe.tpp

@@ -24,6 +24,7 @@ void Universe::load(std::string const & name, std::string const & fallback) {
   if (!fs::exists(location)) { return; }
 
   auto import = [this](fs::path const & file) {
+    if (file.extension() != "json") { return; }
     Json::Value json;
     std::ifstream in(file.string());
     in >> json;