From 0ecc48f4f7fbb6fd4a7a975bd24da656fc4a00c1 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Thu, 19 May 2022 16:25:42 -0400 Subject: [PATCH] Show an error if None is specified as values parameter in Listbox element --- PySimpleGUI.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index aeaaca29..fbd0fa79 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.60.0.4 Unreleased" +version = __version__ = "4.60.0.5 Unreleased" _change_log = """ Changelog since 4.60.0 released to PyPI on 8-May-2022 @@ -18,6 +18,8 @@ _change_log = """ 4.60.0.4 New location parameter option for Windows. Setting location=None tells PySimpleGUI to not set any location when window is created. It's up to the OS to decide. The docstring for Window has been changed, but not all the other places (like popup). Want to make sure this works before making all those changes. + 4.60.0.5 + Added check for None invalid values parm when creating a Listbox element """ __version__ = version.split()[0] # For PEP 396 and PEP 345 @@ -2500,6 +2502,9 @@ class Listbox(Element): :type metadata: (Any) """ + if values is None: + _error_popup_with_traceback('Error in your Listbox definition - The values parameter cannot be None', 'Use an empty list if you want no values in your Listbox') + self.Values = values self.DefaultValues = default_values self.TKListbox = None