A possible NULL-pointer deference.

The test in get_unit_type_function was reversed.
This commit is contained in:
Mark de Wever 2012-02-18 11:54:00 +00:00
parent 92c3721add
commit 3bd183450a
2 changed files with 4 additions and 2 deletions

View file

@ -101,6 +101,7 @@ Version 1.11.0-svn:
Preferences (patch #3115)
* Show base terrain description if none for overlay (bug #19411)
* Added wesmage tool to test SDL image manipulation functions.
* Fixed: A possible NULL-pointer deference in get_unit_type_function.
Version 1.10.0:
* Campaigns:

View file

@ -892,8 +892,9 @@ private:
const std::string type = args()[0]->evaluate(variables,add_debug_info(fdb,0,"get_unit_type:name")).as_string();
const unit_type *ut = unit_types.find(type);
if (!ut)
return variant( new unit_type_callable(*ut));
if(ut) {
return variant(new unit_type_callable(*ut));
}
return variant();
}