aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests.lua b/tests.lua
index 4421b57..f519964 100755
--- a/tests.lua
+++ b/tests.lua
@@ -32,7 +32,11 @@ local test_opensubtitles = function ()
ohash = '395787dbe5b42001'
id = '5449593'
- new_id = opensubtitles.search_ohash(ohash):match('%d*$')
+ new_id = opensubtitles.search_ohash(ohash)
+ if new_id then
+ new_id = new_id:match('%d*$')
+ end
+
if id ~= new_id then
util.error('opensubtitles: id mismatch')
errs = errs + 1