Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Coefficient panic #144

Merged
merged 1 commit into from
Oct 9, 2019
Merged

fix: Coefficient panic #144

merged 1 commit into from
Oct 9, 2019

Conversation

forsaken628
Copy link
Contributor

call Coefficient on uninitialized Decimal will panic

call Coefficient on uninitialized Decimal will panic
@bmperrea
Copy link

bmperrea commented Oct 2, 2019

@njason We've been working around this for a bit in our projects by adding early outs if the decimal is zero before calling Coefficient. Please take a look! A simple test is decimal.Zero.Coefficient() // panics

Copy link
Member

@njason njason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@njason njason merged commit 2677b5d into shopspring:master Oct 9, 2019
@forsaken628
Copy link
Contributor Author

Temporary solution

d = d.Shift(0)
bi := d.Coefficient()

flemeur pushed a commit to flemeur/decimal that referenced this pull request Nov 5, 2019
fairyhunter13 added a commit to fairyhunter13/decimal that referenced this pull request Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants