From 3615ca6b95def9adb37e652a451adc3f1b9a8de7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 20 Apr 2020 16:02:29 +0200 Subject: [PATCH] VersionName can be null when running integration test --- .../vector/matrix/android/internal/network/UserAgentHolder.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/network/UserAgentHolder.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/network/UserAgentHolder.kt index 0f3da0c834..15c91a629a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/network/UserAgentHolder.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/network/UserAgentHolder.kt @@ -51,7 +51,7 @@ internal class UserAgentHolder @Inject constructor(private val context: Context, appName = pm.getApplicationLabel(appInfo).toString() val pkgInfo = pm.getPackageInfo(context.applicationContext.packageName, 0) - appVersion = pkgInfo.versionName + appVersion = pkgInfo.versionName ?: "" // Use appPackageName instead of appName if appName contains any non-ASCII character if (!appName.matches("\\A\\p{ASCII}*\\z".toRegex())) {