Skip to content

fix: Don't generate warnings with null values#22

Open
TheWitness wants to merge 1 commit into
developfrom
double-issue
Open

fix: Don't generate warnings with null values#22
TheWitness wants to merge 1 commit into
developfrom
double-issue

Conversation

@TheWitness

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent PHP warnings when rendering UPS list rows if ups_timeleft is NULL (likely due to round() receiving NULL).

Changes:

  • Cast ups_timeleft to float before calling round() in the UPS list table output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread upses.php
form_selectable_ecell(checkNullandReturn($ups['ups_line_voltage']), $ups['id'], '', 'right');
form_selectable_ecell(checkNullandReturn($ups['ups_load_percent']), $ups['id'], '', 'right');
form_selectable_ecell(round($ups['ups_timeleft'],2), $ups['id'], '', 'right');
form_selectable_ecell(round((float) $ups['ups_timeleft'],2), $ups['id'], '', 'right');
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.

6 participants