Don't worry about being defensive in generated code.
Only try and sort buses with a valid controller.