Fix GetJobAttributes method

GetJobAttributes was always returning: "server doesn't return any job attributes" in my case. Turns out it's because it wasn't returning the correct response value. This should fix this.
This commit is contained in:
the-goodies 2021-04-02 21:38:19 +03:00 committed by GitHub
parent 6a590a71e5
commit 2ecd656eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -231,11 +231,11 @@ func (c *IPPClient) GetJobAttributes(jobID int, attributes []string) (Attributes
return nil, err
}
if len(resp.PrinterAttributes) == 0 {
if len(resp.JobAttributes) == 0 {
return nil, errors.New("server doesn't return any job attributes")
}
return resp.PrinterAttributes[0], nil
return resp.JobAttributes[0], nil
}
// GetJobs returns jobs from a printer or class