Skip to content

Commit

Permalink
fixed bug with null p.BlockData
Browse files Browse the repository at this point in the history
  • Loading branch information
c-darwin committed Sep 2, 2016
1 parent cd0b413 commit 3309ba2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/dcparser/votes_promised_amount.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ func (p *Parser) VotesPromisedAmountFront() error {
if err != nil {
return p.ErrInfo(err)
}
p.getAdminUserId(p.BlockData.BlockId)

var blockId int64
if p.BlockData != nil {
blockId = p.BlockData.BlockId
}
p.getAdminUserId(blockId)
if num > 0 && p.TxUserID != p.AdminUserId { // админу можно
return p.ErrInfo("double voting")
}
Expand Down
6 changes: 5 additions & 1 deletion packages/dcparser/votes_sn_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ func (p *Parser) VotesSnUserFront() error {
if err != nil {
return p.ErrInfo(err)
}
p.getAdminUserId(p.BlockData.BlockId)
var blockId int64
if p.BlockData != nil {
blockId = p.BlockData.BlockId
}
p.getAdminUserId(blockId)
if num > 0 && p.TxUserID != p.AdminUserId { // админу можно
return p.ErrInfo("double voting")
}
Expand Down

0 comments on commit 3309ba2

Please sign in to comment.