Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 392409b

Browse files
committed
Fix possible NullPointerException if install failed. (Fix #167)
1 parent 2c5a552 commit 392409b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/main/java/com/fox2code/mmm/installer/InstallerActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ private void doInstall(File file, boolean noExtensions, boolean rootless) {
360360
installExecutable = this.extractInstallScript("anykernel3_installer.sh");
361361
if (installExecutable == null) {
362362
this.setInstallStateFinished(false,
363-
"! Failed to extract AnyKernel3 install script", null);
363+
"! Failed to extract AnyKernel3 install script", "");
364364
return;
365365
}
366366
// "unshare -m" is needed to force mount namespace isolation.
@@ -379,15 +379,15 @@ private void doInstall(File file, boolean noExtensions, boolean rootless) {
379379
installExecutable = this.extractInstallScript("module_installer_compat.sh");
380380
if (installExecutable == null) {
381381
this.setInstallStateFinished(false,
382-
"! Failed to extract Magisk module install script", null);
382+
"! Failed to extract Magisk module install script", "");
383383
return;
384384
}
385385
installCommand = ASH + " \"" +
386386
installExecutable.getAbsolutePath() + "\"" +
387387
" 3 1 \"" + file.getAbsolutePath() + "\"";
388388
} else {
389389
this.setInstallStateFinished(false,
390-
"! Zip file is not a valid Magisk module or AnyKernel3 zip!", null);
390+
"! Zip file is not a valid Magisk module or AnyKernel3 zip!", "");
391391
return;
392392
}
393393
installerMonitor = new InstallerMonitor(installExecutable);
@@ -697,7 +697,7 @@ private void setInstallStateFinished(boolean success, String message, String opt
697697

698698
if (message != null && !message.isEmpty())
699699
this.installerTerminal.addLine(message);
700-
if (!optionalLink.isEmpty()) {
700+
if (optionalLink != null && !optionalLink.isEmpty()) {
701701
this.setActionBarExtraMenuButton(ActionButtonType.supportIconForUrl(optionalLink),
702702
menu -> {
703703
IntentHelper.openUrl(this, optionalLink);

0 commit comments

Comments
 (0)