Vérifiez si le stockage local est utilisé ou vide

if (localStorage.length > 0){
    //Items are stored in local storage
}else{
    //Local storage is empty
}
Zany Zebra