VersionName can be null when running integration test

This commit is contained in:
Benoit Marty 2020-04-20 16:02:29 +02:00
parent ddb00ba23a
commit 3615ca6b95
1 changed files with 1 additions and 1 deletions

View File

@ -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())) {