Only clear users db if the filename is set.

This commit is contained in:
Valentin Lorentz 2019-09-28 10:33:54 +02:00
parent bcbaa979d5
commit 3c42ce0861
1 changed files with 4 additions and 4 deletions

View File

@ -650,11 +650,11 @@ class UsersDictionary(utils.IterableMap):
def reload(self):
"""Reloads the database from its file."""
self.nextId = 0
self.users.clear()
self._nameCache.clear()
self._hostmaskCache.clear()
if self.filename is not None:
self.nextId = 0
self.users.clear()
self._nameCache.clear()
self._hostmaskCache.clear()
try:
self.open(self.filename)
except EnvironmentError as e: