I'm quite new to Python and so my knowledge is limited, but I'm trying to create a script that changes the symbology of a group of layers within an mxd. the feature classes are saved in a gdb, and each feature class needs a unique symbology. I have layer files stored in a folder that correspond to each feature class. I'm able to symbolize each feature class using the following
NOGO12_Hab="NOGO2012_Habitat"
Symbol_2012Hab = r"C:Field_Data\Symbology Layers\2012_Habitat.lyr"
arcpy.ApplySymbologyFromLayer_management(NOGO12_Hab,Symbol_2012Hab)
I've then duplicated this for each feature class and its required symbology. I'm running into problems where the feature class in the TOC is blank or doesn't exist, and returns an error. Is there a way to have the script skip the blank or missing feature classes?