Helge Wrede 8 жил өмнө
parent
commit
2a041f8135
1 өөрчлөгдсөн 12 нэмэгдсэн , 5 устгасан
  1. 12 5
      util/FileIO.cpp

+ 12 - 5
util/FileIO.cpp

@@ -280,14 +280,21 @@ namespace util
 
                 // Try to parse the value
                 double value;
-                try
+
+                if (part.empty())
                 {
-                    value = std::stof(part.c_str());
+                    value = 0.0;
                 }
-                catch (std::exception& e)
+                else
                 {
-                    util::Logger::LogError(e.what());
-                    value = 0.0;
+                    try
+                    {
+                        value = std::stof(part.c_str());
+                    }
+                    catch (std::exception & e)
+                    {
+                        util::Logger::LogError(e.what());
+                    }
                 }
 
                 // Store the value