Skip to content

Commit

Permalink
Check if gamemode is null
Browse files Browse the repository at this point in the history
Signed-off-by: BT (calcastor/mame) <[email protected]>
  • Loading branch information
calcastor committed Aug 25, 2024
1 parent af699f9 commit 60b984c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions core/src/main/java/tc/oc/pgm/map/MapInfoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,17 @@ public Component getStyledName(MapNameStyle style) {
private Component parseGamemode(Element root) throws InvalidXMLException {
Component gamemode = XMLUtils.parseFormattedText(Node.fromLastChildOrAttr(root, "game"));

final Element blitz = root.getChild("blitz");
if (blitz != null) {
final Element title = blitz.getChild("title");
if (title != null) {
if (this.getProto().isNoOlderThan(MapProtos.REMOVE_BLITZ_TITLE)) {
throw new InvalidXMLException(
"<title> inside <blitz> is no longer supported, use <map game=\"...\">", title);
if (gamemode == null) {
final Element blitz = root.getChild("blitz");
if (blitz != null) {
final Element title = blitz.getChild("title");
if (title != null) {
if (this.getProto().isNoOlderThan(MapProtos.REMOVE_BLITZ_TITLE)) {
throw new InvalidXMLException(
"<title> inside <blitz> is no longer supported, use <map game=\"...\">", title);
}
gamemode = XMLUtils.parseFormattedText(Node.fromNullable(title));
}
gamemode = XMLUtils.parseFormattedText(Node.fromNullable(title));
}
}

Expand Down

0 comments on commit 60b984c

Please sign in to comment.