PM-3349 PM-3350 MAUI Migration fix nullable bindings and fallbacks
This commit is contained in:
parent
b8f0747dd4
commit
d17789d5ee
|
@ -37,7 +37,7 @@ namespace Bit.App.Pages
|
|||
set => SetProperty(ref _cipher, value, additionalPropertyNames: AdditionalPropertiesToRaiseOnCipherChanged);
|
||||
}
|
||||
|
||||
public string CreationDate => string.Format(AppResources.CreatedXY, Cipher.CreationDate.ToShortDateString(), Cipher.CreationDate.ToShortTimeString());
|
||||
public string CreationDate => string.Format(AppResources.CreatedXY, Cipher?.CreationDate.ToShortDateString(), Cipher?.CreationDate.ToShortTimeString());
|
||||
|
||||
public AsyncCommand CheckPasswordCommand { get; }
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
StyleClass="box-label" />
|
||||
<Entry
|
||||
x:Name="_nameEntry"
|
||||
Text="{Binding Cipher.Name}"
|
||||
Text="{Binding Cipher.Name, FallbackValue=''}"
|
||||
StyleClass="box-value"
|
||||
AutomationProperties.IsInAccessibleTree="True"
|
||||
SemanticProperties.Description="{u:I18n Name}"
|
||||
|
@ -219,7 +219,7 @@
|
|||
Grid.RowSpan="2"
|
||||
AutomationProperties.IsInAccessibleTree="True"
|
||||
SemanticProperties.Description="{u:I18n GeneratePassword}"
|
||||
IsVisible="{Binding Cipher.ViewPassword}"
|
||||
IsVisible="{Binding Cipher.ViewPassword, FallbackValue=False}"
|
||||
AutomationId="RegeneratePasswordButton" />
|
||||
</Grid>
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ using Microsoft.Maui.Controls;
|
|||
using Microsoft.Maui;
|
||||
using Bit.App.Utilities;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public class CipherAddEditPageViewModel : BaseCipherViewModel
|
||||
|
@ -883,7 +885,7 @@ namespace Bit.App.Pages
|
|||
Cipher.OrganizationId = OwnershipOptions[OwnershipSelectedIndex].Value;
|
||||
TriggerCipherChanged();
|
||||
}
|
||||
if (Cipher.OrganizationId != null)
|
||||
if (Cipher?.OrganizationId != null)
|
||||
{
|
||||
var cols = _writeableCollections.Where(c => c.OrganizationId == Cipher.OrganizationId)
|
||||
.Select(c => new CollectionViewModel { Collection = c }).ToList();
|
||||
|
|
Loading…
Reference in New Issue