Incorrect handle portType input

checking for nil