1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Android: Fix crash on opening settings on old versions of Android (#10793)

This commit is contained in:
Henry Heino 2024-07-29 14:18:16 -07:00 committed by GitHub
parent 39ad1e23a8
commit 60e347a782
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,10 +7,11 @@ import { _ } from '@joplin/lib/locale';
const getWebViewVersionText = () => {
if (Platform.OS === 'android') {
const constants = NativeModules.SystemVersionInformationModule.getConstants();
// SystemVersionInformationModule is unavailable on older versions of Android.
const constants = NativeModules.SystemVersionInformationModule?.getConstants();
return [
_('WebView version: %s', constants.webViewVersion),
_('WebView package: %s', constants.webViewPackage),
_('WebView version: %s', constants?.webViewVersion ?? _('Unknown')),
_('WebView package: %s', constants?.webViewPackage ?? _('Unknown')),
].join('\n');
}
return null;