Skip to content

Commit

Permalink
add an assert in random_generate_scenario
Browse files Browse the repository at this point in the history
it's better than segfault.
  • Loading branch information
gfgtdf committed Jul 1, 2014
1 parent 79b95f7 commit ae095c5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/generators/map_create.cpp
Expand Up @@ -63,6 +63,7 @@ config random_generate_scenario(const std::string& parms, const config &cfg)
//the first token is the name of the generator, tokens after
//that are arguments to the generator
std::vector<std::string> parameters = utils::split(parms, ' ');
assert(!parameters.empty()); //we use parameters.front() in the next line.
util::scoped_ptr<map_generator> generator(create_map_generator(parameters.front(),cfg));
if(generator == NULL) {
ERR_CF << "could not find map generator '" << parameters.front() << "'" << std::endl;
Expand Down

0 comments on commit ae095c5

Please sign in to comment.