added a tweak to PeerItemOrder GetPrice in order to not crash on nil Purchase
This commit is contained in:
parent
83e590d4e1
commit
98a2359c9d
@ -185,6 +185,11 @@ type PeerItemOrder struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *PeerItemOrder) GetPrice(request *tools.APIRequest) (float64, error) {
|
func (d *PeerItemOrder) GetPrice(request *tools.APIRequest) (float64, error) {
|
||||||
|
/////////// Temporary in order to allow GenerateOrder to complete while billing is still WIP
|
||||||
|
if d.Purchase == nil {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
///////////
|
||||||
var priced *resources.PricedResource
|
var priced *resources.PricedResource
|
||||||
b, _ := json.Marshal(d.Item)
|
b, _ := json.Marshal(d.Item)
|
||||||
err := json.Unmarshal(b, priced)
|
err := json.Unmarshal(b, priced)
|
||||||
|
Loading…
Reference in New Issue
Block a user