Skip to content

p4Info task throws System.NullReferenceException - BUG #29

@bwojtowi

Description

@bwojtowi

p4Info executes ToString() on the values Perforce.GetP4Info(find) returns without checking if ithey are not nulls. Taking into account that Perforce.GetP4Info(find) returns an array of string it's not needed at all and introduces a bug only.

protected override void ExecuteTask()
{
string[] find = {"User name:", "Client name:", "Client host:", "Client root:"};
string[] results = Perforce.GetP4Info(find);

Project.Properties[User] = results[0].ToString();            <-- BUG
Project.Properties[Client] = results[1].ToString();           <-- BUG 
Project.Properties[Host] = results[2].ToString();            <-- BUG
Project.Properties[Root] = results[3].ToString();            <-- BUG

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions