Prevent weird Magisk version number crashing app

This commit is contained in:
topjohnwu 2016-10-18 21:54:53 +08:00
parent 906ae730e9
commit e5be8b7f67

View File

@ -167,10 +167,10 @@ public class MagiskFragment extends Fragment {
private void updateMagiskVersion() { private void updateMagiskVersion() {
List<String> ret = Shell.sh("getprop magisk.version"); List<String> ret = Shell.sh("getprop magisk.version");
if (ret.get(0).isEmpty()) { try {
magiskVersion = -1;
} else {
magiskVersion = Integer.parseInt(ret.get(0)); magiskVersion = Integer.parseInt(ret.get(0));
} catch (NumberFormatException e) {
magiskVersion = -1;
} }
if (magiskVersion == -1) { if (magiskVersion == -1) {