Skip to content

Conversation

@RyanDDDDDD
Copy link

Summary

Simplified the conditional check for language retrieval to improve readability.

Changes

  • Replaced the expression if (!language?.Published ?? false) with a clearer equivalent:
    if (language == null || !language.Published)
        language = await _workContext.GetWorkingLanguageAsync();

@RyanDDDDDD RyanDDDDDD changed the title refactor: simplify null and published check for language Refactor: simplify null and published check for language Dec 11, 2025
@RomanovM
Copy link
Contributor

@RyanDDDDDD Why? There are tons of similar checks within the solution

@RyanDDDDDD
Copy link
Author

The reason I changed this specific check is readability.

if (language == null || !language.Published) is easier to parse at a glance than
if (!language?.Published ?? false)

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.

2 participants