logger: Use an option_fd when we know open can fail.

This commit is contained in:
Emmanuel Gil Peyrot 2018-07-22 16:50:08 +02:00
parent c55759e001
commit eb89a5252a

View file

@ -192,9 +192,10 @@ class Logger:
if jid in self._fds.keys():
fd = self._fds[jid]
else:
fd = self._check_and_create_log_dir(jid)
if not fd:
return True
option_fd = self._check_and_create_log_dir(jid)
if option_fd is None:
return True
fd = option_fd
filename = log_dir / jid
try:
fd.write(logged_msg)