From 8569ef7dbbc35fd089637966cfce2ac82e2eed7d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 11 Jun 2016 22:40:08 -0400 Subject: [PATCH] Fixes #6489 - Was comparing string against dictionary key without checking if the key existed first. --- couchpotato/core/media/_base/providers/torrent/hd4free.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/media/_base/providers/torrent/hd4free.py b/couchpotato/core/media/_base/providers/torrent/hd4free.py index af0bf5a..20ac0ca 100644 --- a/couchpotato/core/media/_base/providers/torrent/hd4free.py +++ b/couchpotato/core/media/_base/providers/torrent/hd4free.py @@ -25,10 +25,11 @@ class Base(TorrentProvider): def _search(self, movie, quality, results): data = self.getJsonData(self.urls['search'] % (self.conf('apikey'), self.conf('username'), getIdentifier(movie), self.conf('internal_only'))) - if data: - if self.login_fail_msg in data['error']: # Check for login failure - self.disableAccount() - return + if 'error' in data: + if data: + if self.login_fail_msg in data['error']: # Check for login failure + self.disableAccount() + return try: #for result in data[]: