From 705f7b43aa8e66c5fe81c4b0912920d20e4a7952 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 30 Aug 2016 10:48:26 +0200 Subject: [PATCH] Make SpiceEphemeris check for the kernel existence before trying to load --- modules/base/ephemeris/spiceephemeris.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/base/ephemeris/spiceephemeris.cpp b/modules/base/ephemeris/spiceephemeris.cpp index 36c81ac26a..85df8a21c9 100644 --- a/modules/base/ephemeris/spiceephemeris.cpp +++ b/modules/base/ephemeris/spiceephemeris.cpp @@ -27,6 +27,8 @@ #include #include +#include + namespace { const std::string _loggerCat = "SpiceEphemeris"; //const std::string keyGhosting = "EphmerisGhosting"; @@ -59,8 +61,15 @@ SpiceEphemeris::SpiceEphemeris(const ghoul::Dictionary& dictionary) for (size_t i = 1; i <= kernels.size(); ++i) { std::string kernel; bool success = kernels.getValue(std::to_string(i), kernel); - if (!success) + if (!success) { LERROR("'" << KeyKernels << "' has to be an array-style table"); + break; + } + + if (!FileSys.fileExists(kernel)) { + LERROR("Kernel '" << kernel << "' does not exist"); + continue; + } try { SpiceManager::ref().loadKernel(kernel);