Close buffered_file only if it exists
This commit is contained in:
parent
04827b4691
commit
f5c661925c
@ -1274,6 +1274,7 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
||||
document = buffered_file
|
||||
except FileNotFoundError:
|
||||
document = None
|
||||
if buffered_file:
|
||||
buffered_file.close()
|
||||
else:
|
||||
use_stored_file_id = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user