Catch mapgen errors in editor, fixing bug #13549
This commit is contained in:
parent
b22f0d5e98
commit
76dda277a9
1 changed files with 8 additions and 2 deletions
|
@ -487,8 +487,14 @@ void editor_controller::generate_map_dialog()
|
|||
dialog.set_gui(&gui());
|
||||
dialog.show(gui().video());
|
||||
if (dialog.get_retval() == gui2::twindow::OK) {
|
||||
std::string map_string =
|
||||
dialog.get_selected_map_generator()->create_map(std::vector<std::string>());
|
||||
std::string map_string;
|
||||
try {
|
||||
map_string = dialog.get_selected_map_generator()
|
||||
->create_map(std::vector<std::string>());
|
||||
} catch (mapgen_exception& e) {
|
||||
gui::message_dialog(gui(), _("Map creation failed."), e.what()).show();
|
||||
return;
|
||||
}
|
||||
if (map_string.empty()) {
|
||||
gui::message_dialog(gui(), "", _("Map creation failed.")).show();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue