Valiate ports tree exists before using it