aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 02bffa84d..580260ade 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1667,7 +1667,8 @@ int main(int argc, char *argv[])
}
// Set world path to selected one
- if(menudata.selected_world != -1){
+ if ((menudata.selected_world >= 0) &&
+ (menudata.selected_world < worldspecs.size())) {
worldspec = worldspecs[menudata.selected_world];
infostream<<"Selected world: "<<worldspec.name
<<" ["<<worldspec.path<<"]"<<std::endl;