Skip to content

Commit

Permalink
Comparison nullable addreses fix
Browse files Browse the repository at this point in the history
  • Loading branch information
docbender committed May 14, 2021
1 parent e424145 commit bbabeb7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,14 @@ public void prepareData() {
@Override
public int compare(SimaticChannel o1, SimaticChannel o2) {
var o1A = o1.getStateAddress();
if (o1A == null) {
if (o2.getStateAddress() == null) {
return 0;
} else {
return 1;
}
}
return (o1A).compareTo(o2.getStateAddress());
var o2A = o2.getStateAddress();
if (o1A != null && o2A != null) {
return (o1A).compareTo(o2A);
} else if (o2A != null) {
return 1;
} else {
return 0;
}
}
});

Expand Down

0 comments on commit bbabeb7

Please sign in to comment.