This issue crashes the software for lack of specific handling if ln.local_pubkey does not have a score, returning None and crashing the "info_box" function at line 29 grid.add_row( "score : ", "{:,}".format(score.get(ln.local_pubkey)))) as we are dealing with format with a {:,} specification it can't handle and ends up crashing:
info = info_box(ln, score)
File "/home/admin/suez/suez.py", line 29, in info_box
grid.add_row("score : ", "{:,}".format(score.get(ln.local_pubkey)))
TypeError: unsupported format string passed to NoneType.__format
How to solve?
Creating a variable that will get the Score and when it is added to the grid will do a little get_score if get_score else 0 check this is code:
What is the problem?
This issue crashes the software for lack of specific handling if ln.local_pubkey does not have a
score
, returning None and crashing the "info_box" function at line 29grid.add_row( "score : ", "{:,}".format(score.get(ln.local_pubkey))))
as we are dealing with format with a{:,}
specification it can't handle and ends up crashing:How to solve?
Creating a variable that will get the
Score
and when it is added to the grid will do a littleget_score if get_score else 0
check this is code:This is a very stupid problem, but it can cause problems for users who want to use the tool and don't have a technical background.