From 57ca1d0eb626643097b15840c5dc03faef9080dc Mon Sep 17 00:00:00 2001 From: Kristian Flikka Date: Tue, 27 Aug 2013 10:06:55 +0200 Subject: [PATCH] Added an else clause that throws, should check before getting --- opm/parser/eclipse/Parser/Parser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opm/parser/eclipse/Parser/Parser.cpp b/opm/parser/eclipse/Parser/Parser.cpp index d96cb1b67..a65a32f24 100644 --- a/opm/parser/eclipse/Parser/Parser.cpp +++ b/opm/parser/eclipse/Parser/Parser.cpp @@ -61,6 +61,8 @@ namespace Opm { if (hasKeyword(keyword)) { return m_parserKeywords.at(keyword); } + else + throw std::invalid_argument("Keyword: " + keyword + " does not exist"); } void Parser::parseFile(DeckPtr deck, const std::string &file, bool parseStrict) const {