Fixed a small traceback that was happening when translating a direct message

This commit is contained in:
Manuel Cortez 2021-08-26 09:16:02 -05:00
parent 3d8519313e
commit f9864a887d
2 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ class basicTweet(object):
else:
self.message.disable_button("shortenButton")
self.message.disable_button("unshortenButton")
if self.message.get("long_tweet") == False:
if self.message.get("long_tweet") == False and hasattr(self, "max"):
text = self.message.get_text()
results = parse_tweet(text)
self.message.set_title(_(u"%s - %s of %d characters") % (self.title, results.weightedLength, self.max))

View File

@ -467,5 +467,5 @@ class viewNonTweet(widgetUtils.BaseDialog):
self.text.SetFocus()
def enable_button(self, buttonName):
if getattr(self, buttonName):
if hasattr(self, buttonName):
return getattr(self, buttonName).Enable()