Put some guard code around setting frame priorities.