Commit b5f2265
committed
Consolidated the content type validation logic
Previously, the `contentType` (now `contentTypeDescriptor`) was defined in one block, but validated in a later block. These are now brought together. In addition, the `GetContentTypeDescriptors()` collection is confirmed to contain the content type before retrieving it. Otherwise, the validation will never fire, and instead a less-intuitive `IndexOutOfRangeException` will be thrown.
It's worth noting that we no longer _need_ the `ContentTypeDescriptor` here. Instead, this is needed by the new `GetAttributes()` and `GetNullableAttributes()` methods on `TopicRepositoryBase` (see #6662f07, #2237a02), which call `GetContentTypes()` on their own. To reduce the number of times this needs to be looked up and validated, it may make more sense to just relay this to `GetAttributes()` and `GetNullableAttributes()` in the future; we'll need to consider that.1 parent daa6705 commit b5f2265
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
659 | 660 | | |
660 | 661 | | |
661 | 662 | | |
662 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
663 | 671 | | |
664 | 672 | | |
665 | 673 | | |
| |||
678 | 686 | | |
679 | 687 | | |
680 | 688 | | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | 689 | | |
687 | 690 | | |
688 | 691 | | |
| |||
0 commit comments