Skip to content

Commit

Permalink
Just cap to MaxInt64
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Apr 14, 2022
1 parent 55ab073 commit 2a8f640
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/base64"
"encoding/hex"
"fmt"
"math"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -238,6 +239,11 @@ func formatDuration(d *xdr.Duration) null.Int {
if d == nil {
return null.Int{}
}

if *d > math.MaxInt64 {
*d = xdr.Duration(math.MaxInt64)
}

return null.IntFrom(int64(*d))
}

Expand Down

0 comments on commit 2a8f640

Please sign in to comment.