File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55using Android . Content ;
66using Android . Content . PM ;
77using Android . OS ;
8+ using Android . Util ;
89using Android . Views ;
910using Android . Widget ;
1011using Google . Android . Material . Dialog ;
@@ -36,7 +37,7 @@ public KeeShareAdapter(ConfigureKeeShareActivity context)
3637
3738 public override Java . Lang . Object GetItem ( int position )
3839 {
39- return position ;
40+ return _displayedItems [ position ] ;
4041 }
4142
4243 public override long GetItemId ( int position )
@@ -241,8 +242,16 @@ protected override void OnCreate(Bundle savedInstanceState)
241242 string uuidString = savedInstanceState . GetString ( PendingConfigItemUuidKey ) ;
242243 if ( ! string . IsNullOrEmpty ( uuidString ) )
243244 {
244- var uuid = new PwUuid ( Convert . FromBase64String ( uuidString ) ) ;
245- _pendingConfigItem = _adapter . _displayedItems . FirstOrDefault ( i => i . Group . Uuid . Equals ( uuid ) ) ;
245+ try
246+ {
247+ var uuid = new PwUuid ( Convert . FromBase64String ( uuidString ) ) ;
248+ _pendingConfigItem = _adapter . _displayedItems . FirstOrDefault ( i => i . Group . Uuid . Equals ( uuid ) ) ;
249+ }
250+ catch ( Exception ex ) when ( ex is FormatException || ex is ArgumentException )
251+ {
252+ Log . Error ( "ConfigureKeeShareActivity" , "Failed to reconstruct PwUuid from saved state" , ex ) ;
253+ _pendingConfigItem = null ;
254+ }
246255 }
247256 }
248257 }
You can’t perform that action at this time.
0 commit comments