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 division by zero when memory data is not available #85

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Mar 19, 2020

The total memory values may be zero when bottom is run on an unsupported
(or not-fully-supported) platform.

The previous behavior resulted in a NaN value for the memory datapoints,
which was passed through to tui-rs which ultimately panicked when
attempting to graph the memory widget.

Description

A description of the change and what it does. If relevant, please provide screenshots of what results from the change:

Issue

If applicable, what issue does this address?

Closes: #

Type of change

Remove the irrelevant ones:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (something else - please specify if relevant):

Test methodology

Please state how this was tested:

Please tick which platforms this change was tested on:

  • Windows
  • macOS
  • Linux

Checklist

Please ensure all are ticked (and actually done):

  • Change has been tested to work
  • Areas your change affects has been linted using rustfmt
  • Code has been self-reviewed
  • Code has been tested and no new breakage is introduced
  • Documentation has been added/updated if needed
  • No merge conflicts arise from the change

Other information

Provide any other relevant information:

The total memory values may be zero when bottom is run on an unsupported
(or not-fully-supported) platform.

The previous behavior resulted in a NaN value for the memory datapoints,
which was passed through to tui-rs which ultimately panicked when
attempting to graph the memory widget.
@ClementTsang
Copy link
Owner

LGTM, thanks!

@ClementTsang ClementTsang merged commit 2b418fb into ClementTsang:master Mar 20, 2020
Repository owner deleted a comment from allcontributors bot Mar 20, 2020
@ClementTsang
Copy link
Owner

@all-contributors add @mqudsi for code

@allcontributors
Copy link
Contributor

@ClementTsang

I've put up a pull request to add @mqudsi! 🎉

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.

2 participants