forked from organicmaps/organicmaps
[android] Fixed reivew notes https://github.com/mapsme/omim/pull/9901#discussion_r236224505
This commit is contained in:
parent
c4533600de
commit
55d1a37633
1 changed files with 26 additions and 3 deletions
|
@ -170,10 +170,33 @@ public class UgcRoutePropertiesFragment extends BaseMwmFragment implements Bookm
|
|||
public void onCustomPropertiesReceived(boolean successful,
|
||||
@NonNull List<CatalogCustomProperty> properties)
|
||||
{
|
||||
if (successful && properties.size() != 0 && properties.iterator().next().getOptions().size() != 0)
|
||||
onLoadSuccess(properties);
|
||||
else
|
||||
if (!successful)
|
||||
{
|
||||
onLoadFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
if (properties.isEmpty())
|
||||
{
|
||||
onLoadFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
CatalogCustomProperty property = properties.iterator().next();
|
||||
if (property == null)
|
||||
{
|
||||
onLoadFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
List<CatalogCustomPropertyOption> options = property.getOptions();
|
||||
if (options.size() <= SECOND_OPTION_INDEX)
|
||||
{
|
||||
onLoadFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
onLoadSuccess(properties);
|
||||
}
|
||||
|
||||
private void onLoadFailed()
|
||||
|
|
Loading…
Add table
Reference in a new issue