Fix: Categories Edit - nullable bool conversion error

Fixed type conversion error in Categories/Edit.cshtml where Model.IsActive (bool?)
was being evaluated in a ternary operator that requires non-nullable bool.

Changed from: @(Model.IsActive ? "checked" : "")
To: @(Model.IsActive == true ? "checked" : "")

This properly handles null, false, and true values for the checkbox.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-10-03 13:31:34 +01:00
parent 125513dbc6
commit 5552917f0d

View File

@ -38,7 +38,7 @@
<div class="mb-3"> <div class="mb-3">
<div class="form-check"> <div class="form-check">
<input name="IsActive" id="IsActive" class="form-check-input" type="checkbox" @(Model.IsActive ? "checked" : "") /> <input name="IsActive" id="IsActive" class="form-check-input" type="checkbox" @(Model.IsActive == true ? "checked" : "") />
<label for="IsActive" class="form-check-label"> <label for="IsActive" class="form-check-label">
Active Active
</label> </label>