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 crash when adding instrument with a float as aperture or focal_length #289

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

WimDeMeester
Copy link
Contributor

Fixes the crash that appears when adding an new instrument with aperture (or focal length) as a float instead of an integer.

@brickbots Can you add this to the next release?

@jscheidtmann
Copy link
Contributor

I can still enter invalid numbers in Chrome, like "123.345e4443". The message displayed then says "Instrument added, restart PiFinder to use".

the error message in the log is:

2025-02-20 07:46:55,497 Webserver-Server:ERROR:Error adding instrument: invalid literal for int() with base 10: ''

@jscheidtmann
Copy link
Contributor

jscheidtmann commented Feb 20, 2025

Further note that on Safari (iPhone iOS 18.3.1) you can still enter other characters.
It's not crashing anymore.

If you change multiple entries and only one item is wrong, none of the changes is stored. Do we want that?

@WimDeMeester
Copy link
Contributor Author

In the html input element, I have put number and 123.345e4443 is indeed a number, meaning 123.345 times 10 to the power 4443. Converting this to an integer will indeed not work, because an integer can not store such a large number. Maybe I can limit the aperture to some reasonable value, but the question is indeed what a reasonable value is...

@brickbots brickbots merged commit 3a7a3c0 into brickbots:main Feb 24, 2025
1 check passed
@brickbots
Copy link
Owner

Thank you for helping to make this more robust!

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