Skip to content

Commit

Permalink
fix #21007, fix failing unit test, patch by StephaneP
Browse files Browse the repository at this point in the history
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19325 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Feb 16, 2025
1 parent 106fd3a commit d025105
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/org/openstreetmap/josm/io/nmea/NmeaParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ public boolean parseNMEASentence(String s) throws IllegalDataException {
return false;
}
} else {
// Since there is no checksum, we remove any line endings
chkstrings[0] = chkstrings[0].replaceAll("\\r|\\n", "");
noChecksum++;
}
// now for the content
Expand Down Expand Up @@ -443,9 +445,11 @@ public boolean parseNMEASentence(String s) throws IllegalDataException {
}
}
// Age of differential correction
accu = e[GGA.GPS_AGE.position];
if (!accu.isEmpty() && currentwp != null) {
currentwp.put(GpxConstants.PT_AGEOFDGPSDATA, Float.valueOf(accu));
if (GGA.GPS_AGE.position < e.length) {
accu = e[GGA.GPS_AGE.position];
if (!accu.isEmpty() && currentwp != null) {
currentwp.put(GpxConstants.PT_AGEOFDGPSDATA, Float.valueOf(accu));
}
}
// reference ID
if (GGA.REF.position < e.length) {
Expand Down

0 comments on commit d025105

Please sign in to comment.