Skip to content

Enhance code robustness and maintainability by standardizing string and null checks. - #157

Merged
Timthreetwelve merged 2 commits into
mainfrom
Cleanup
Aug 28, 2026
Merged

Enhance code robustness and maintainability by standardizing string and null checks.#157
Timthreetwelve merged 2 commits into
mainfrom
Cleanup

Conversation

@Timthreetwelve

Copy link
Copy Markdown
Owner
  • Refactored null and empty string checks for improved safety and clarity:
    • Removed unnecessary null-forgiving operator from HistoryHelpers when accessing HistoryList.Count.
    • Updated PathHelpers to use .Length == 0 instead of Path.GetExtension(filename) == string.Empty.
    • Changed ERROR_NO_ASSOCIATION in TextFileViewer to a const int for consistency.
    • Replaced fileName == string.Empty with .Length == 0 in NavigationViewModel for better null safety.
  • Removed unused xmlns:local and SpacingConverter from AboutPage.xaml
  • Moved translations Expander from Grid.Row 12 to 11 for better layout
  • Made ThemeTypes in SettingsViewModel.cs get-only for immutability
  • Simplified PathHelpers.FindOnPath call in TextFileViewer.cs
  • Updated log message formatting in TextFileViewer.cs for consistency

No related issues or pull requests.

- Removed unused xmlns:local and SpacingConverter from AboutPage.xaml
- Moved translations Expander from Grid.Row 12 to 11 for better layout
- Made ThemeTypes in SettingsViewModel.cs get-only for immutability
- Simplified PathHelpers.FindOnPath call in TextFileViewer.cs
- Updated log message formatting in TextFileViewer.cs for consistency

No related issues or pull requests.
- Refactored null and empty string checks for improved safety and clarity:
  - Removed unnecessary null-forgiving operator from `HistoryHelpers` when accessing `HistoryList.Count`.
  - Updated `PathHelpers` to use `.Length == 0` instead of `Path.GetExtension(filename) == string.Empty`.
  - Changed `ERROR_NO_ASSOCIATION` in `TextFileViewer` to a `const int` for consistency.
  - Replaced `fileName == string.Empty` with `.Length == 0` in `NavigationViewModel` for better null safety.
- These changes enhance code robustness and maintainability by standardizing string and null checks.

No related issues or pull requests.
@Timthreetwelve Timthreetwelve changed the title These changes enhance code robustness and maintainability by standardizing string and null checks. Enhance code robustness and maintainability by standardizing string and null checks. Aug 28, 2026
@Timthreetwelve
Timthreetwelve merged commit 651f976 into main Aug 28, 2026
2 checks passed
@Timthreetwelve
Timthreetwelve deleted the Cleanup branch August 28, 2026 20:04
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.

1 participant