浏览代码

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

Sam Jaffe 1 年之前
父节点
当前提交
ef7f82f2be
共有 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;