From 6bd4fff31e0b44b8b71876250c626fe8c15b4105 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 12 Sep 2011 18:29:12 +0300 Subject: Add missing checks to some files and style fixes. --- src/event.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/event.cpp') diff --git a/src/event.cpp b/src/event.cpp index 5a1d673b2..6913e8660 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -56,7 +56,7 @@ int Event::getInt(const std::string &key) const throw (BadEvent) if (it == mData.end()) throw BAD_KEY; - if (it->second->getType() != VariableData::DATA_INT) + if (!it->second || it->second->getType() != VariableData::DATA_INT) throw BAD_VALUE; return static_cast(it->second)->getData(); @@ -78,7 +78,7 @@ const std::string &Event::getString(const std::string &key) if (it == mData.end()) throw BAD_KEY; - if (it->second->getType() != VariableData::DATA_STRING) + if (!! it->second || it->second->getType() != VariableData::DATA_STRING) throw BAD_VALUE; return static_cast(it->second)->getData(); @@ -99,7 +99,7 @@ double Event::getFloat(const std::string &key) const throw (BadEvent) if (it == mData.end()) throw BAD_KEY; - if (it->second->getType() != VariableData::DATA_FLOAT) + if (!it->second || it->second->getType() != VariableData::DATA_FLOAT) throw BAD_VALUE; return static_cast(it->second)->getData(); -- cgit v1.2.3-70-g09d2