fix for crash when pasting in illegal chars into single line text input

This commit is contained in:
MikeTheWatchGuy 2018-11-16 19:18:52 -05:00
parent 4243b1dc17
commit eff8660e18
1 changed files with 9 additions and 2 deletions

View File

@ -513,7 +513,11 @@ class InputText(Element):
self.DefaultText = value
def Get(self):
return self.TKStringVar.get()
try:
text = self.TKStringVar.get()
except:
text = ''
return text
def SetFocus(self):
@ -3665,7 +3669,10 @@ def BuildResultsForSubform(form, initialize_only, top_level_form):
if not initialize_only:
if element.Type == ELEM_TYPE_INPUT_TEXT:
value = element.TKStringVar.get()
try:
value = element.TKStringVar.get()
except:
value = ''
if not top_level_form.NonBlocking and not element.do_not_clear and not top_level_form.ReturnKeyboardEvents:
element.TKStringVar.set('')
elif element.Type == ELEM_TYPE_INPUT_CHECKBOX: