Handle the case where localStorage is inaccessible.