Skip to content

Commit

Permalink
Fix regression introduced with v2.1 for finding the nearest partner
Browse files Browse the repository at this point in the history
This should fix null-pointer exceptions for commands like tp or seen when the partner is offline
#108
  • Loading branch information
GeorgH93 committed Jan 26, 2020
1 parent bb0b79c commit d30f532
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>at.pcgamingfreaks</groupId>
<artifactId>MarriageMaster</artifactId>
<version>2.1.1</version>
<version>2.1.2</version>

<scm>
<connection>scm:git:[email protected]:GeorgH93/MarriageMaster.git</connection>
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Language:
# Options: {Name}, {Date}, {Count}, {CountTotalDays}
LastSeen: "[\"\",{\"text\":\"{Name} was last seen on \",\"extra\":[{\"text\":\"{Date}\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"{Count} ago\"}},{\"text\":\".\"}]}]"
# No Json!!!
DateFormat: "yyyy.MM.dd 'at' HH:mm:ss"
DateFormat: "yyyy-MM-dd 'at' HH:mm:ss"
List:
Format: "&2{Player1DisplayName} <heart> &2{Player2DisplayName}"
NoMarriedPlayers: "[\"\",{\"text\":\"There are no married players.\",\"color\":\"red\"}]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 GeorgH93
* Copyright (C) 2020 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -138,7 +138,7 @@ public Marriage getNearestPartnerMarriageData()
for(Marriage marriage : getMultiMarriageData())
{
double dist = marriage.getDistance();
if(dist > 0 && (dist < distanceNearest || distanceNearest == -1))
if((dist > 0 && dist < distanceNearest) || distanceNearest == -1)
{
distanceNearest = dist;
nearest = marriage;
Expand Down

0 comments on commit d30f532

Please sign in to comment.