Mitigates a fatal `ArgumentError` when enum type is nil

**Error Description:**

`comparison of String with nil failed (ArgumentError)`

**Patch Description:**

- before `types` array is `sort`ed, checks that each type is non-`nil`