Handlebars-Net / Handlebars.Net

A real .NET Handlebars engine
MIT License
1.24k stars 214 forks source link

Fix for issue #457 #510

Closed Dragwar closed 2 years ago

Dragwar commented 2 years ago

Includes:

First time contributing, my fix is to remove the following if check in order to return a normal ObjectDescriptor within the ObjectDescriptorProvider.TryGetDescriptor(...) method.

// ObjectDescriptorProvider.cs
public bool TryGetDescriptor(Type type, out ObjectDescriptor value)
{
    if (type == StringType)
    {
        value = ObjectDescriptor.Empty;
        return false;
    }
    ...
}

I don't fully understand the reasoning behind this if check. This if check was added in "Introduce reactive helper registration, improve general performance" - commit: 9d52004.

Anyway this PR removes this check, let me know if you don't think this is a good change or have any suggestions.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication