Skip to content

Commit

Permalink
Android: Fix crash on opening settings on old versions of Android (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator authored Jul 29, 2024
1 parent 39ad1e2 commit 60e347a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/app-mobile/utils/getVersionInfoText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60e347a

Please sign in to comment.