Skip to content

Commit 27226c1

Browse files
author
Jasper Geurtz
committed
setMap should return false on empty mapFileName not throw
1 parent d0fd63e commit 27226c1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎src/main/java/bwapi/Game.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,10 +2380,9 @@ public int getLastEventTime() {
23802380
* parameter.
23812381
*/
23822382
final public boolean setMap(final String mapFileName) {
2383-
if (mapFileName == null || mapFileName.length() >= 260 || mapFileName.charAt(0) == 0) {
2383+
if (mapFileName == null || mapFileName.isEmpty() || mapFileName.length() >= 260 || mapFileName.charAt(0) == 0) {
23842384
return false;
23852385
}
2386-
23872386
addCommand(CommandType.SetMap, mapFileName, 0);
23882387
return true;
23892388
}

0 commit comments

Comments
 (0)