Don't segfault on an invalid port ID