Prevent UnboundLocalError

This commit is contained in:
Davte 2019-09-29 20:16:39 +02:00
parent aa6f45887e
commit 0e268414f9
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,7 @@ __author__ = "Davide Testa"
__email__ = "davide@davte.it"
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
__license__ = "GNU General Public License v3.0"
__version__ = "2.3.1"
__version__ = "2.3.2"
__maintainer__ = "Davide Testa"
__contact__ = "t.me/davte"

View File

@ -863,6 +863,7 @@ async def _query_command(bot, update, user_record):
bot,
['query', ]
)
query_id = None
if len(query) == 0:
return bot.get_message(
'admin', 'query_command', 'help',
@ -918,7 +919,7 @@ async def _query_command(bot, update, user_record):
make_button(
text='CSV',
prefix='db_query:///',
data=['csv', query_id]
data=(['csv', query_id] if query_id else [])
)
],
1