Applied-Scientific-Research / Omega3D

GPU-accelerated 3D vortex methods solver with easy GUI
GNU General Public License v3.0
12 stars 6 forks source link

Crash when json on command line doesn't exist #14

Closed markstock closed 2 years ago

markstock commented 3 years ago

When running something like Omega3D.bin threeblobs.json where the json file does not exist, the program crashes with the following ugly error:

Omega3D.bin: /home/mstock/asr/version3/Omega3D/src/json/json.hpp:17944: const value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::operator[](T*) const [with T = const char; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::const_reference = const nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::value_type = nlohmann::basic_json<>]: Assertion `m_value.object->find(key) != m_value.object->end()' failed.
Aborted (core dumped)

What should happen is the program opens, and a dialog opens saying that we couldn't find that file.

markstock commented 2 years ago

This no longer occurs.