Fixed that persistentContainer and therefore context is nil if during login screen app enters background
This commit is contained in:
parent
360e75426f
commit
93de8bf252
|
@ -16,8 +16,9 @@ class CoreDataBankingPersistence: IBankingPersistence, ITransactionPartySearcher
|
|||
return persistentContainer!.viewContext
|
||||
}()
|
||||
|
||||
|
||||
func saveContext () {
|
||||
if context.hasChanges {
|
||||
if persistentContainer != nil && context.hasChanges {
|
||||
do {
|
||||
try context.save()
|
||||
} catch {
|
||||
|
|
Loading…
Reference in New Issue