diff --git a/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt b/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt index dd323384c..783579f80 100644 --- a/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +++ b/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt @@ -908,7 +908,12 @@ internal fun mapFromShippingContact(googlePayResult: GooglePayResult): WritableM postalAddress.putString("country", googlePayResult.shippingInformation?.address?.country) postalAddress.putString("postalCode", googlePayResult.shippingInformation?.address?.postalCode) postalAddress.putString("state", googlePayResult.shippingInformation?.address?.state) - postalAddress.putString("street", googlePayResult.shippingInformation?.address?.line1 + "\n" + googlePayResult.shippingInformation?.address?.line2) + val line1: String? = googlePayResult.shippingInformation?.address?.line1 + val line2: String? = googlePayResult.shippingInformation?.address?.line2 + val street = + (if (line1 != null) "$line1" else "") + + (if (line2 != null) "\n$line2" else "") + postalAddress.putString("street", street) postalAddress.putString("isoCountryCode", googlePayResult.shippingInformation?.address?.country) map.putMap("postalAddress", postalAddress) return map