Bugfixes (Crash on startup) #6332- fixed

This commit is contained in:
madwasp79 2019-01-21 13:07:59 +02:00
parent be33d0cfc8
commit dd58cac831
2 changed files with 7 additions and 3 deletions

View file

@ -1399,7 +1399,10 @@ public class ConfigureMapMenu {
public static int parseTrackColor(RenderingRulesStorage renderer, String colorName) {
int defaultColor = -1;
RenderingRule gpxRule = renderer.getRenderingAttributeRule("gpx");
RenderingRule gpxRule = null;
if(renderer!=null) {
gpxRule = renderer.getRenderingAttributeRule("gpx");
}
if (gpxRule != null && gpxRule.getIfElseChildren().size() > 0) {
List<RenderingRule> rules = renderer.getRenderingAttributeRule("gpx").getIfElseChildren().get(0).getIfElseChildren();
for (RenderingRule r : rules) {

View file

@ -889,7 +889,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
boolean needMapAdjust = currentMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN;
if (newMenuState != currentMenuState) {
restoreCustomMapRatio();
//restoreCustomMapRatio();
menu.updateControlsVisibility(true);
doBeforeMenuStateChange(currentMenuState, newMenuState);
toggleDetailsHideButton();
@ -899,6 +899,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}
private void restoreCustomMapRatio() {
//do we need this? setCustomRatio never used, so what we restoring?
if (map != null && map.hasCustomMapRatio()) {
map.restoreMapRatio();
}
@ -1245,7 +1246,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
@Override
public void onPause() {
restoreCustomMapRatio();
//restoreCustomMapRatio();
if (view != null) {
ViewParent parent = view.getParent();