From 71f7b25ab3c8302972998714e98a5126cf1259e5 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Tue, 3 Oct 2023 09:17:48 +0530 Subject: tests: fix, avoid matching on nil --- tests.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3