Cannot unwrap safety let constant in swift ui

Hi everyone.
I have two variables, i can create third :slight_smile:
Here is, what i whant to implement - when user updating his username - it writing on base.
To slow increase base loading i whant to add time limit to allow it. It’s done.
let currentDate = Int(NSDate().timeIntervalSince1970)
let nextDateLoginUpdate = currentDate - sessionStore.userSession!.loginUpdateDate

But sometimes, when user do this - app crashes with error on this force unwrapping constant - .userSession!.
By the way - full path of constant - let nextDateLoginUpdate = currentDate - sessionStore.userSession!.loginUpdateDate
I have tried to use if statements, or guard let, not works…
Also i have tried to do like this:
let currentDate = Int(NSDate().timeIntervalSince1970)
let userSessionTime = sessionStore.userSession?.loginUpdateDate
let nextDateLoginUpdate = currentDate - userSessionTime
i’m getting:
The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

What do you mean here?? What exactly are you trying to do?

You should only need to do let currentDate = Date() to create a new date object