#1312 Resolves issue with radio reference editor attempting to access county info for a site that has county ID set to 0 (ie no county specified). (#1379)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2022-12-24 04:45:21 -05:00
committed by GitHub
parent 8707eb2c88
commit 7a58bf85b6

View File

@@ -34,6 +34,11 @@ import io.github.dsheirer.rrapi.type.Type;
import io.github.dsheirer.rrapi.type.Voice;
import io.github.dsheirer.service.radioreference.RadioReference;
import io.github.dsheirer.util.ThreadPool;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.property.IntegerProperty;
@@ -55,12 +60,6 @@ import jiconfont.javafx.IconNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
/**
* Radio Reference editor for trunked radio systems
*/
@@ -293,7 +292,13 @@ public class SystemEditor extends VBox
List<EnrichedSite> enrichedSites = new ArrayList<>();
for(Site site: sites)
{
CountyInfo countyInfo = mRadioReference.getService().getCountyInfo(site.getCountyId());
CountyInfo countyInfo = null;
if(site.getCountyId() > 0)
{
countyInfo = mRadioReference.getService().getCountyInfo(site.getCountyId());
}
enrichedSites.add(new EnrichedSite(site, countyInfo));
}