GP-186 - Ghidra Dev Plugin - applied previous fix to an additional file

This commit is contained in:
dragonmacher 2020-09-30 15:15:00 -04:00
parent b816f4a939
commit 947c99a170

View File

@ -33,6 +33,7 @@ import ghidra.GhidraApplicationLayout;
import ghidradev.EclipseMessageUtils;
import ghidradev.ghidraprojectcreator.utils.GhidraScriptUtils;
import ghidradev.ghidraprojectcreator.wizards.pages.*;
import utilities.util.FileUtilities;
/**
* Wizard to create a new Ghidra scripting project.
@ -147,8 +148,8 @@ public class CreateGhidraScriptProjectWizard extends Wizard implements INewWizar
* @return True if the data returned from the wizard pages are valid; otherwise, false
*/
private boolean validate() {
if (projectPage.getProjectDir().getAbsolutePath().startsWith(
ghidraInstallationPage.getGhidraInstallDir().getAbsolutePath())) {
if (FileUtilities.isPathContainedWithin(ghidraInstallationPage.getGhidraInstallDir(),
projectPage.getProjectDir())) {
EclipseMessageUtils.showErrorDialog("Invalid Project Root Directory",
"Project root directory cannot reside inside of the selected Ghidra installation directory.");
return false;