make sure that 'OC_Theme' exists before checking if the method exists

fix for #9627