Fix tests

This commit is contained in:
Victor Shcherb 2017-03-25 21:02:27 +01:00
parent 17f4fd4108
commit 84c33798ea
3 changed files with 3 additions and 3 deletions

View file

@ -505,7 +505,7 @@ public class SearchUICore {
@Override
public boolean publish(SearchResult object) {
if (!phrase.getNameStringMatcher().matches(object.localeName)) {
if (phrase != null && !phrase.getNameStringMatcher().matches(object.localeName)) {
for (String s : object.otherNames) {
if (phrase.getNameStringMatcher().matches(s)) {
object.alternateName = s;

View file

@ -289,7 +289,7 @@ public class SearchPhrase {
}
public ObjectType[] getSearchTypes() {
return settings.getSearchTypes();
return settings == null ? null : settings.getSearchTypes();
}
public boolean isCustomSearch() {

View file

@ -15,7 +15,7 @@ import org.junit.Test;
public class LocationSearchTest {
private void search(String string, LatLon latLon) throws IOException {
SearchResultMatcher srm = new SearchUICore.SearchResultMatcher(null, 0, null, 100);
SearchResultMatcher srm = new SearchUICore.SearchResultMatcher(null, null, 0, null, 100);
new SearchCoreFactory.SearchLocationAndUrlAPI().
search(new SearchPhrase(null, OsmAndCollator.primaryCollator()).generateNewPhrase(string, null), srm);
Assert.assertEquals(1, srm.getRequestResults().size());