diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8186e26c8..c90e6fde3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1671,9 +1671,10 @@ int main(int argc, char *argv[]) //infostream<<"Main: password hash: '"<<password<<"'"<<std::endl; address = menudata.address; - int newport = stoi(menudata.port); - if(newport != 0) - port = newport; + try { + port = stoi(menudata.port); + } + catch (NumericException&e) {} simple_singleplayer_mode = menudata.simple_singleplayer_mode; |