Default to empty object if localStorage is not accessible.

Add try and catch block to account for instances when the localStorage exists but is not accessible. For example if the user has their browser set to block cookies and site data.