Skip to content

Commit e4cee56

Browse files
committed
Fix launch crash on macOS 13 x86_64 and release v0.3.2
Guard NSApp access in AppTheme.apply() — NSApp is nil during AppSettingsManager singleton init on macOS 13 Ventura x86_64, causing EXC_BAD_INSTRUCTION (ud2 trap) at launch.
1 parent 545b307 commit e4cee56

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.3.2] - 2026-02-14
11+
12+
### Fixed
13+
14+
- Fix launch crash on macOS 13 (Ventura) x86_64 caused by accessing `NSApp.appearance` before `NSApplication` is initialized during settings singleton setup
15+
1016
## [0.3.1] - 2026-02-14
1117

1218
### Fixed
@@ -148,7 +154,8 @@ TablePro is a native macOS database client built with SwiftUI and AppKit, design
148154
- Custom SQL query templates
149155
- Performance optimized for large datasets
150156

151-
[Unreleased]: https://github.com/datlechin/tablepro/compare/v0.3.1...HEAD
157+
[Unreleased]: https://github.com/datlechin/tablepro/compare/v0.3.2...HEAD
158+
[0.3.2]: https://github.com/datlechin/tablepro/compare/v0.3.1...v0.3.2
152159
[0.3.1]: https://github.com/datlechin/tablepro/compare/v0.3.0...v0.3.1
153160
[0.3.0]: https://github.com/datlechin/tablepro/compare/v0.2.0...v0.3.0
154161
[0.2.0]: https://github.com/datlechin/tablepro/compare/v0.1.1...v0.2.0

TablePro.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
CODE_SIGN_IDENTITY = "Apple Development";
303303
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
304304
CODE_SIGN_STYLE = Automatic;
305-
CURRENT_PROJECT_VERSION = 5;
305+
CURRENT_PROJECT_VERSION = 6;
306306
DEAD_CODE_STRIPPING = YES;
307307
DEVELOPMENT_TEAM = D7HJ5TFYCU;
308308
ENABLE_APP_SANDBOX = NO;
@@ -333,7 +333,7 @@
333333
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
334334
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Libs";
335335
MACOSX_DEPLOYMENT_TARGET = 13.5;
336-
MARKETING_VERSION = 0.3.1;
336+
MARKETING_VERSION = 0.3.2;
337337
"OTHER_LDFLAGS[arch=arm64]" = (
338338
"-force_load",
339339
"$(PROJECT_DIR)/Libs/libmariadb.a",
@@ -392,7 +392,7 @@
392392
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
393393
CODE_SIGN_STYLE = Automatic;
394394
COPY_PHASE_STRIP = YES;
395-
CURRENT_PROJECT_VERSION = 5;
395+
CURRENT_PROJECT_VERSION = 6;
396396
DEAD_CODE_STRIPPING = YES;
397397
DEPLOYMENT_POSTPROCESSING = YES;
398398
DEVELOPMENT_TEAM = D7HJ5TFYCU;
@@ -424,7 +424,7 @@
424424
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
425425
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/Libs";
426426
MACOSX_DEPLOYMENT_TARGET = 13.5;
427-
MARKETING_VERSION = 0.3.1;
427+
MARKETING_VERSION = 0.3.2;
428428
"OTHER_LDFLAGS[arch=arm64]" = (
429429
"-force_load",
430430
"$(PROJECT_DIR)/Libs/libmariadb.a",

TablePro/Models/AppSettings.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ enum AppTheme: String, Codable, CaseIterable, Identifiable {
115115

116116
/// Apply this theme to the app
117117
func apply() {
118+
guard let app = NSApp else { return }
118119
switch self {
119120
case .system:
120-
NSApp.appearance = nil
121+
app.appearance = nil
121122
case .light:
122-
NSApp.appearance = NSAppearance(named: .aqua)
123+
app.appearance = NSAppearance(named: .aqua)
123124
case .dark:
124-
NSApp.appearance = NSAppearance(named: .darkAqua)
125+
app.appearance = NSAppearance(named: .darkAqua)
125126
}
126127
}
127128
}

0 commit comments

Comments
 (0)