Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Preallocated attributes breaks the null-check on indexers #1057

Closed
rynowak opened this issue Mar 7, 2017 · 1 comment
Closed

Preallocated attributes breaks the null-check on indexers #1057

rynowak opened this issue Mar 7, 2017 · 1 comment
Assignees
Milestone

Comments

@rynowak
Copy link
Member

rynowak commented Mar 7, 2017

From aspnet/Mvc#5920 (comment)

The relevant bits:

            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["page"] = (string)__tagHelperAttribute_0.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
            if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null)
            {
                throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues"));
            }

The RouteValues is accessed before the error check. page in this case is a preallocated attribute.

@ajaybhargavb
Copy link
Contributor

27ac5da

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants