From 6e5e2ff2f53fd3bbda4776003496628d0955cf1e Mon Sep 17 00:00:00 2001
From: Greg DiCristofaro <gregd@basistech.com>
Date: Wed, 23 Aug 2023 12:59:58 -0400
Subject: [PATCH] fix for local app data on non-windows systems

---
 .../df/cybertriage/autopsy/incidentoptions/CTSettings.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTSettings.java b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTSettings.java
index 35e2d108ea..67abb34f7b 100644
--- a/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTSettings.java
+++ b/Core/src/com/basistech/df/cybertriage/autopsy/incidentoptions/CTSettings.java
@@ -20,6 +20,7 @@
 import java.util.Objects;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import org.apache.commons.lang3.StringUtils;
 import org.openide.modules.Places;
 
 /**
@@ -38,7 +39,11 @@ private static String getAppDataLocalDirectory() {
             LOGGER.log(Level.INFO, "Application Data (test mode) Path: " + Places.getUserDirectory().getAbsolutePath());
             return Places.getUserDirectory().getAbsolutePath();
         } else {
-            Path localAppPath = Paths.get(System.getenv("LOCALAPPDATA"), "cybertriage");
+            
+            Path localAppPath = StringUtils.isBlank(System.getenv("LOCALAPPDATA"))
+                    ? Places.getUserDirectory().toPath().toAbsolutePath()
+                    : Paths.get(System.getenv("LOCALAPPDATA"), "cybertriage");
+            
             try {
                 Files.createDirectories(localAppPath);
                 LOGGER.log(Level.INFO, "Application Data Path: " + localAppPath.toString());
-- 
GitLab