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
|
return persistentContainer!.viewContext
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
||||||
func saveContext () {
|
func saveContext () {
|
||||||
if context.hasChanges {
|
if persistentContainer != nil && context.hasChanges {
|
||||||
do {
|
do {
|
||||||
try context.save()
|
try context.save()
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in New Issue