Fix crash on Safari Private Mode, or when localStorage is turned off