Skip to content

Commit fde67fb

Browse files
committed
feat(Android): make applicationInfo nullable
1 parent b796f42 commit fde67fb

File tree

1 file changed

+3
-3
lines changed
  • android/src/main/java/com/freeraspreactnative/utils

1 file changed

+3
-3
lines changed

android/src/main/java/com/freeraspreactnative/utils/Utils.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ internal object Utils {
1616
val byteArrayOutputStream = ByteArrayOutputStream()
1717
bitmap.compress(Bitmap.CompressFormat.PNG, 10, byteArrayOutputStream)
1818
val byteArray = byteArrayOutputStream.toByteArray()
19-
return Base64.encodeToString(byteArray, Base64.DEFAULT)
19+
return Base64.encodeToString(byteArray, Base64.NO_WRAP)
2020
}
2121

2222
/**
2323
* Retrieves human-readable application name
2424
*/
25-
internal fun getAppName(context: ReactContext, applicationInfo: ApplicationInfo): String {
26-
return context.packageManager.getApplicationLabel(applicationInfo) as String
25+
internal fun getAppName(context: ReactContext, applicationInfo: ApplicationInfo?): String? {
26+
return applicationInfo?.let { context.packageManager.getApplicationLabel(it) as String }
2727
}
2828

2929
/**

0 commit comments

Comments
 (0)