diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-07-18 22:54:21 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-07-18 22:54:21 -0700 |
commit | 88ad050f3c2f9f11bafb56a8cf777518795295a9 (patch) | |
tree | 4db5ae29f321d48819a816cbb68046bdd8aaf335 | |
parent | 89bfa0c633f3096cca6f983bca1507d3f4b902a8 (diff) |
XQuartz: Add some sanity checking and a fallback for the bundle id.
This way we'll print an error and still mostly work rather than crashing if
someone installs XQuartz.app incorrectly or tries running the server within
the build system rather than the installed system.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | hw/xquartz/X11Application.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 3973110fe..320bca179 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1004,6 +1004,11 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { app_prefs_domain_cfstr = (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]; + if (app_prefs_domain_cfstr == NULL) { + ErrorF("X11ApplicationMain: Unable to determine bundle identifier. Your installation of XQuartz may be broken.\n"); + app_prefs_domain_cfstr = @BUNDLE_ID_PREFIX".X11"; + } + [NSApp read_defaults]; [NSBundle loadNibNamed:@"main" owner:NSApp]; [[NSNotificationCenter defaultCenter] addObserver:NSApp |