Hotfix. Added checking for nil subnodes
This commit is contained in:
parent
53f872a72d
commit
8817bd521a
2 changed files with 7 additions and 3 deletions
|
|
@ -16,6 +16,6 @@ deploy:
|
||||||
- docker login $REGISTRY_NAME -u $DOCKER_USER -p $DOCKER_PASSWORD
|
- docker login $REGISTRY_NAME -u $DOCKER_USER -p $DOCKER_PASSWORD
|
||||||
- docker push $IMAGE_NAME
|
- docker push $IMAGE_NAME
|
||||||
- docker push $DOCKER_IMAGE_TAG
|
- docker push $DOCKER_IMAGE_TAG
|
||||||
- "curl -X POST -H \"Authorization: Bearer $GOCD_ACCESS_TOKEN\" -d '{\"repository_url\": \"https://gitlab.com/flygrounder/go-mtg-vk.git\"}' http://165.22.85.27:8153/go/admin/materials/git/notify"
|
# - "curl -X POST -H \"Authorization: Bearer $GOCD_ACCESS_TOKEN\" -d '{\"repository_url\": \"https://gitlab.com/flygrounder/go-mtg-vk.git\"}' http://165.22.85.27:8153/go/admin/materials/git/notify"
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,13 @@ func GetPricesScg(name string) ([]CardPrice, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
editionNode := htmlquery.FindOne(block, "//p[@class=\"hawk-results-item__category\"]/a")
|
editionNode := htmlquery.FindOne(block, "//p[@class=\"hawk-results-item__category\"]/a")
|
||||||
price.Edition = editionNode.FirstChild.Data
|
if editionNode.FirstChild != nil {
|
||||||
|
price.Edition = editionNode.FirstChild.Data
|
||||||
|
}
|
||||||
priceNode := htmlquery.FindOne(block, "//div[contains(concat(' ',normalize-space(@class),' '),' hawk-results-item__options-table-cell--price ')]")
|
priceNode := htmlquery.FindOne(block, "//div[contains(concat(' ',normalize-space(@class),' '),' hawk-results-item__options-table-cell--price ')]")
|
||||||
price.Price = priceNode.FirstChild.Data
|
if priceNode.FirstChild != nil {
|
||||||
|
price.Price = priceNode.FirstChild.Data
|
||||||
|
}
|
||||||
results = append(results, price)
|
results = append(results, price)
|
||||||
}
|
}
|
||||||
return results, nil
|
return results, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue