From bfd16302f11525a966090d880bb8c7ac847cb1fe Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:54:20 -0500 Subject: [PATCH] GP-4109 - Fixed failure to open the last used project when running a new release of Ghidra the first time --- .../main/java/ghidra/framework/preferences/Preferences.java | 6 +++--- .../ghidra/framework/project/DefaultProjectManager.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/preferences/Preferences.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/preferences/Preferences.java index d00698c7e7..1d9c3b0e78 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/preferences/Preferences.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/preferences/Preferences.java @@ -195,7 +195,7 @@ public class Preferences { /** * Get the property with the given name. *

- * Note: all getProperty(...) methods will first check {@link System#getProperty(String)} + * Note: all getProperty(...) methods will check {@link System#getProperty(String)} * for a value first. This allows users to override preferences from the command-line. * @param name the property name * @return the current property value; null if not set @@ -213,7 +213,7 @@ public class Preferences { /** * Get the property with the given name; if there is no property, return the defaultValue. *

- * Note: all getProperty(...) methods will first check {@link System#getProperty(String)} + * Note: all getProperty(...) methods will check {@link System#getProperty(String)} * for a value first. This allows users to override preferences from the command-line. * @param name the property name * @param defaultValue the default value @@ -237,7 +237,7 @@ public class Preferences { * This version of getProperty will, when useHistoricalValue is true, look * for the given preference value in the last used installation of the application. *

- * Note: all getProperty(...) methods will first check {@link System#getProperty(String)} + * Note: all getProperty(...) methods will check {@link System#getProperty(String)} * for a value first. This allows users to override preferences from the command-line. * * @param name The name of the property for which to get a value diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/DefaultProjectManager.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/DefaultProjectManager.java index aa510f4f32..557b3fcc59 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/DefaultProjectManager.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/DefaultProjectManager.java @@ -192,7 +192,7 @@ public class DefaultProjectManager implements ProjectManager { */ @Override public ProjectLocator getLastOpenedProject() { - String projectPath = Preferences.getProperty(LAST_OPENED_PROJECT); + String projectPath = Preferences.getProperty(LAST_OPENED_PROJECT, null, true); if (projectPath == null || projectPath.trim().length() == 0) { return null; }