From f9ec121a030730127073da051cb0e788fedb95f0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 21 Sep 2021 13:56:50 +0300 Subject: [PATCH] Fix #4461 - "PIN & (NULL)" when device biometrics not available (or not enrolled). --- Riot/Modules/Settings/Security/SecurityViewController.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/Settings/Security/SecurityViewController.m b/Riot/Modules/Settings/Security/SecurityViewController.m index b0191ae74c..ecd994d38a 100644 --- a/Riot/Modules/Settings/Security/SecurityViewController.m +++ b/Riot/Modules/Settings/Security/SecurityViewController.m @@ -292,9 +292,12 @@ - (void)updateSections Section *pinCodeSection = [Section sectionWithTag:SECTION_PIN_CODE]; // Header title - NSString *pinCodeSectionHeaderTitleFormat = NSLocalizedStringFromTable(@"pin_protection_settings_section_header_x", @"Vector", nil); - NSString *pinCodeSectionHeaderTitle = [NSString stringWithFormat:pinCodeSectionHeaderTitleFormat, [PinCodePreferences shared].localizedBiometricsName]; - pinCodeSection.headerTitle = pinCodeSectionHeaderTitle; + if ([PinCodePreferences shared].isBiometricsAvailable) + { + NSString *pinCodeSectionHeaderTitleFormat = NSLocalizedStringFromTable(@"pin_protection_settings_section_header_x", @"Vector", nil); + NSString *pinCodeSectionHeaderTitle = [NSString stringWithFormat:pinCodeSectionHeaderTitleFormat, [PinCodePreferences shared].localizedBiometricsName]; + pinCodeSection.headerTitle = pinCodeSectionHeaderTitle; + } // Rows [pinCodeSection addRowWithTag:PIN_CODE_SETTING];