From 2b7615fe5b972690890b760d70d37b8901a1ab86 Mon Sep 17 00:00:00 2001 From: Zorg Date: Thu, 28 Mar 2024 18:52:28 -0700 Subject: [PATCH] Fallback in case SULocalizedStringFromTableInBundle() fails (#2533) SULocalizedStringFromTableInBundle() should only fail in the abnormal situation where the app bundle may have been moved while it was running. Technically the app is running in an unsupported state but I suppose we can guard against it here. --- Configurations/ConfigCommon.xcconfig | 2 +- Sparkle/SULocalizations.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Configurations/ConfigCommon.xcconfig b/Configurations/ConfigCommon.xcconfig index 5f0a18fa..76dfb4a6 100644 --- a/Configurations/ConfigCommon.xcconfig +++ b/Configurations/ConfigCommon.xcconfig @@ -169,4 +169,4 @@ GCC_WARN_UNUSED_PARAMETER = YES GCC_WARN_UNUSED_VARIABLE = YES // Turn on all warnings, then disable a few which are almost impossible to avoid -WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Werror=undef +WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Werror=undef diff --git a/Sparkle/SULocalizations.h b/Sparkle/SULocalizations.h index 2656bfbb..4a7e590c 100644 --- a/Sparkle/SULocalizations.h +++ b/Sparkle/SULocalizations.h @@ -17,7 +17,8 @@ #define SPARKLE_TABLE @"Sparkle" - #define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) + #define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) (NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) ?: key) + #else #define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) key #endif