CMS: "Edit this template" with nothing selected results in error

Github

Github
dashboard
Improved the display logic for template editing links to ensure they only appear when a valid template is selected, preventing links from showing for empty or invalid values.