Internal change

PiperOrigin-RevId: 998854892
diff --git a/objectivec/GPBMessage.m b/objectivec/GPBMessage.m
index d6fdaa2..8aec2c6 100644
--- a/objectivec/GPBMessage.m
+++ b/objectivec/GPBMessage.m
@@ -3811,8 +3811,9 @@
     NSData *data = [aDecoder decodeObjectOfClass:[NSData class] forKey:kGPBDataCoderKey];
     if (data.length) {
       GPBCodedInputStream *input = [[GPBCodedInputStream alloc] initWithData:data];
+      id<GPBExtensionRegistry> extensionRegistry = nil;
       @try {
-        [self mergeFromCodedInputStream:input extensionRegistry:nil endingTag:0];
+        [self mergeFromCodedInputStream:input extensionRegistry:extensionRegistry endingTag:0];
       } @finally {
         [input release];
       }
@@ -3823,7 +3824,7 @@
 
 - (void)encodeWithCoder:(NSCoder *)aCoder {
 #if defined(DEBUG) && DEBUG
-  if (extensionMap_.count) {
+  if (extensionMap_.count && GPBGetDefaultCodingExtensionRegistry() == nil) {
     // Hint to go along with the docs on GPBMessage about this.
     //
     // Note: This is incomplete, in that it only checked the "root" message,