Bug on DetectProduction #54

Closed
darkfat opened this Issue Oct 24, 2012 · 1 comment

2 participants

@darkfat

Redth-PushSharp-bdfb871\PushSharp.Apple\ApplePushChannelSettings.cs Line: 71 on

The "this.Certificate" seems always null to cause production check always false
Kind of obvious to me that it should be using the "certificate" parameter as passed in.

=== current ===
public bool DetectProduction(X509Certificate2 certificate)
{
bool production = false;

        if (this.Certificate != null)
        {
            var subjectName = this.Certificate.SubjectName.Name;

            if (subjectName.Contains("Apple Production IOS Push Services"))
                production = true;
        }

        return production;
    }

=== suggest ===
public bool DetectProduction(X509Certificate2 certificate)
{
bool production = false;

        if (certificate != null)
        {
            var subjectName = certificate.SubjectName.Name;

            if (subjectName.Contains("Apple Production IOS Push Services"))
                production = true;
        }

        return production;
    }
@Redth
Owner

Thanks, fix is in master and will be in next release :)

@Redth Redth closed this Oct 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment