From 007f9fb51bca1f0a953589b9b511ed3ec98094f6 Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Mon, 21 May 2018 12:02:21 +0300 Subject: [PATCH] Surround library crash with try-catch --- .../net/osmand/plus/voice/AbstractPrologCommandPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java b/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java index 15eac5021e..219010b4be 100644 --- a/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java +++ b/OsmAnd/src/net/osmand/plus/voice/AbstractPrologCommandPlayer.java @@ -126,7 +126,11 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer, Stat @Override public void stateChanged(ApplicationMode change) { if(prologSystem != null) { - prologSystem.getTheoryManager().retract(new Struct("appMode", new Var())); + try { + prologSystem.getTheoryManager().retract(new Struct("appMode", new Var())); + } catch (Exception e) { + log.error("Retract error: ", e); + } prologSystem.getTheoryManager() .assertA( new Struct("appMode", new Struct(ctx.getSettings().APPLICATION_MODE.get().getStringKey()