null handling when looking up device by hostname