Skip to content

Commit 09f3f6c

Browse files
ryanwilsonpaulb777
authored andcommitted
Fix unit testing crash with localization on (#3933)
1 parent 228537c commit 09f3f6c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

GoogleUtilities/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 6.3.1
22
- Fix GULMutableDictionary keyed subscript methods. (#3882)
33
- Update Networking to receive data for POST requests. (#3940)
4+
- Fix crash in GULLogBasic. (#3928)
45

56
# 6.3.0
67
- GULSecureCoding introduced. (#3707)

GoogleUtilities/Logger/GULLogger.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ void GULLogBasic(GULLoggerLevel level,
161161
range:messageCodeRange];
162162
NSCAssert(numberOfMatches == 1, @"Incorrect message code format.");
163163
#endif
164-
NSString *logMsg = [[NSString alloc] initWithFormat:message arguments:args_ptr];
164+
NSString *logMsg;
165+
if (args_ptr == NULL) {
166+
logMsg = message;
167+
} else {
168+
logMsg = [[NSString alloc] initWithFormat:message arguments:args_ptr];
169+
}
165170
logMsg = [NSString stringWithFormat:@"%s - %@[%@] %@", sVersion, service, messageCode, logMsg];
166171
dispatch_async(sGULClientQueue, ^{
167172
asl_log(sGULLoggerClient, NULL, (int)level, "%s", logMsg.UTF8String);

0 commit comments

Comments
 (0)