github_repository_custom_property: avoid panic on empty property_value#3387
github_repository_custom_property: avoid panic on empty property_value#3387SAY-5 wants to merge 3 commits into
Conversation
Signed-off-by: SAY-5 <say.apm35@gmail.com>
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
deiga
left a comment
There was a problem hiding this comment.
Change looks clean. Could you please add a regression test case for this?
…erty_value Pin the panic guard for integrations#3358: the Create path used to index propertyValue[0] without a length check, crashing the provider when the dynamic-block source produced an empty list despite the schema's MinItems=1. Reach the guarded branch from a unit test by passing a nil v3client meta — the empty-list check fires before any API call. Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
|
Pushed c3fd60e, added a unit test that exercises the empty-property_value path for all four single-value property types and asserts a clear error instead of the index-out-of-range panic. Verified locally that the test fails on the pre-fix code and passes on the patched code. |
Fixes #3358.
resourceGithubRepositoryCustomPropertyCreateindexespropertyValue[0]for non-multi-select property types without a length check. When the user supplies an emptyproperty_valueset, the provider panics withindex out of range [0] with length 0. Return a clear error instead.