summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-11-02 21:29:05 +0100
committerCarl Hetherington <cth@carlh.net>2025-11-30 00:42:42 +0100
commitfbe84d722c8db0c812ce54da012d5a6d0a72006f (patch)
tree083e752a886b37281a6e223636010437d0b34e4b
parent465bde70ceb405d05da9b15d19414f4846588e7e (diff)
Fix null pointer dereference if DCPOMATIC_GRAPHICS is unset and resources_path() doesn't exist.
-rw-r--r--src/wx/wx_util.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 7d0329070..331642a13 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -629,15 +629,14 @@ bitmap_path (string name)
#ifdef DCPOMATIC_DEBUG
/* Hack to allow Linux and OS X to find icons when running from the source tree */
- char* path = getenv ("DCPOMATIC_GRAPHICS");
- if (path) {
+ if (char* path = getenv("DCPOMATIC_GRAPHICS")) {
base = path;
} else {
base = resources_path();
}
if (!boost::filesystem::exists(base / name)) {
- base = path / boost::filesystem::path("osx/preferences");
+ base /= boost::filesystem::path("osx/preferences");
}
#else
base = resources_path();