Add null checks for null folders