check for NPE on badWays

This commit is contained in:
afischerdev 2023-07-31 10:24:14 +02:00
parent 03aab82e1e
commit 71dfbac13c

View file

@ -250,8 +250,10 @@ public final class VoiceHintProcessor {
if (input.cmd == VoiceHint.C && !input.goodWay.isLinktType()) { if (input.cmd == VoiceHint.C && !input.goodWay.isLinktType()) {
int badWayPrio = 0; int badWayPrio = 0;
for (MessageData md : input.badWays) { if (input.badWays != null) {
badWayPrio = Math.max(badWayPrio, md.getPrio()); for (MessageData md : input.badWays) {
badWayPrio = Math.max(badWayPrio, md.getPrio());
}
} }
if (input.goodWay.getPrio() < badWayPrio) { if (input.goodWay.getPrio() < badWayPrio) {
results.add(input); results.add(input);