Prevent any check by this function?

Not sure but it seems this line prevented any check: it data['date'] isn't set, it set the local variable then return, without updating prefs. Maybe a misread