Fix file path error in nfandroidtv (#53814)

pull/53621/head^2
Robert Hillis 2021-08-01 04:08:39 -04:00 committed by GitHub
parent 673be4f7dd
commit 822e8645eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -201,8 +201,7 @@ class NFAndroidTVNotificationService(BaseNotificationService):
if local_path is not None:
# Check whether path is whitelisted in configuration.yaml
if self.is_allowed_path(local_path):
with open(local_path, "rb") as path_handle:
return path_handle
return open(local_path, "rb") # pylint: disable=consider-using-with
_LOGGER.warning("'%s' is not secure to load data from!", local_path)
else:
_LOGGER.warning("Neither URL nor local path found in params!")