Skip to content

Handle null input in ConvertFrom by returning empty list#638

Merged
StuartFerguson merged 2 commits into
masterfrom
bug/#622_return_an_empty_collection_instead_of_null
Apr 8, 2026
Merged

Handle null input in ConvertFrom by returning empty list#638
StuartFerguson merged 2 commits into
masterfrom
bug/#622_return_an_empty_collection_instead_of_null

Conversation

@StuartFerguson

Copy link
Copy Markdown
Member

Changed ConvertFrom to return an empty list instead of null when the input model is null, improving null safety and consistency. Moved responses list initialization before the null check to support this behavior.

closes #622

Changed ConvertFrom to return an empty list instead of null
when the input model is null, improving null safety and
consistency. Moved responses list initialization before the
null check to support this behavior.
@codacy-production

codacy-production Bot commented Apr 8, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Changed ModelFactory_ConvertFrom test to assert that converting a null model returns an empty list (Count == 0) rather than null, reflecting updated method behavior.
@StuartFerguson StuartFerguson merged commit 6b241e3 into master Apr 8, 2026
7 of 8 checks passed
@github-actions github-actions Bot deleted the bug/#622_return_an_empty_collection_instead_of_null branch June 8, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BestPractice] Return an empty collection instead of null.

1 participant