Skip to content

Commit 019e41f

Browse files
committed
Update tests for null
1 parent bbe5922 commit 019e41f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

messaging/tests/android/cpp/messaging_test_util.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void OnTokenReceived(const char* tokenstr) {
106106

107107
void OnRegistrationReceived(const char* registration_id) {
108108
flatbuffers::FlatBufferBuilder builder;
109-
auto reg = builder.CreateString(registration_id);
109+
auto reg = builder.CreateString(registration_id ? registration_id : "");
110110
auto regreceived = CreateSerializedRegistrationReceived(builder, reg);
111111
auto event = CreateSerializedEvent(
112112
builder, SerializedEventUnion_SerializedRegistrationReceived,
@@ -117,7 +117,7 @@ void OnRegistrationReceived(const char* registration_id) {
117117

118118
void OnUnregistrationReceived(const char* registration_id) {
119119
flatbuffers::FlatBufferBuilder builder;
120-
auto unreg = builder.CreateString(registration_id);
120+
auto unreg = builder.CreateString(registration_id ? registration_id : "");
121121
auto unregreceived = CreateSerializedUnregistrationReceived(builder, unreg);
122122
auto event = CreateSerializedEvent(
123123
builder, SerializedEventUnion_SerializedUnregistrationReceived,

messaging/tests/ios/messaging_test_util.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ void OnTokenReceived(const char *tokenstr) {
5656

5757
void OnRegistrationReceived(const char *registration_id) {
5858
[[FIRMessaging messaging].delegate messaging:[FIRMessaging messaging]
59-
didReceiveRegistration:@(registration_id)];
59+
didReceiveRegistration:registration_id ? @(registration_id) : nil];
6060
}
6161

6262
void OnUnregistrationReceived(const char *registration_id) {
6363
[[FIRMessaging messaging].delegate messaging:[FIRMessaging messaging]
64-
didUnregister:@(registration_id)];
64+
didUnregister:registration_id ? @(registration_id) : nil];
6565
}
6666

6767
void SleepMessagingTest(double seconds) {

0 commit comments

Comments
 (0)