File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -71,13 +71,21 @@ public class Metadata : CustomStringConvertible, NSCopying {
7171 }
7272
7373 public func key( _ index: Int ) -> ( String ) {
74- return String ( cString: cgrpc_metadata_array_get_key_at_index ( underlyingArray, index) ,
75- encoding: String . Encoding. utf8) !;
74+ if let key = String ( cString: cgrpc_metadata_array_get_key_at_index ( underlyingArray, index) ,
75+ encoding: String . Encoding. utf8) {
76+ return key
77+ } else {
78+ return " <binary-metadata-key> "
79+ }
7680 }
7781
7882 public func value( _ index: Int ) -> ( String ) {
79- return String ( cString: cgrpc_metadata_array_get_value_at_index ( underlyingArray, index) ,
80- encoding: String . Encoding. utf8) !;
83+ if let value = String ( cString: cgrpc_metadata_array_get_value_at_index ( underlyingArray, index) ,
84+ encoding: String . Encoding. utf8) {
85+ return value
86+ } else {
87+ return " <binary-metadata-value> "
88+ }
8189 }
8290
8391 public func add( key: String , value: String ) {
You can’t perform that action at this time.
0 commit comments