Android crash fixes

This commit is contained in:
Anuken
2020-10-23 13:42:28 -04:00
parent 754aba9013
commit f5888a7c56
2 changed files with 24 additions and 20 deletions
@@ -166,7 +166,7 @@ public class AndroidLauncher extends AndroidApplication{
}}); }});
checkFiles(getIntent()); checkFiles(getIntent());
try{
//new external folder //new external folder
Fi data = Core.files.absolute(getContext().getExternalFilesDir(null).getAbsolutePath()); Fi data = Core.files.absolute(getContext().getExternalFilesDir(null).getAbsolutePath());
Core.settings.setDataDirectory(data); Core.settings.setDataDirectory(data);
@@ -190,6 +190,10 @@ public class AndroidLauncher extends AndroidApplication{
t.printStackTrace(); t.printStackTrace();
} }
} }
}catch(Exception e){
//print log but don't crash
Log.err(e);
}
} }
@Override @Override
+1 -1
View File
@@ -321,7 +321,7 @@ public class MapView extends Element implements GestureListener{
} }
private boolean active(){ private boolean active(){
return Core.scene.getKeyboardFocus() != null return Core.scene != null && Core.scene.getKeyboardFocus() != null
&& Core.scene.getKeyboardFocus().isDescendantOf(ui.editor) && Core.scene.getKeyboardFocus().isDescendantOf(ui.editor)
&& ui.editor.isShown() && tool == EditorTool.zoom && && ui.editor.isShown() && tool == EditorTool.zoom &&
Core.scene.hit(Core.input.mouse().x, Core.input.mouse().y, true) == this; Core.scene.hit(Core.input.mouse().x, Core.input.mouse().y, true) == this;