]> git.e2factory.org Git - e2factory.git/commitdiff
cache: Sprinkle assert()
authorTobias Ulmer <tu@emlix.com>
Fri, 23 May 2014 15:30:44 +0000 (17:30 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/cache.lua

index 06accb237b29c4275fdbeb69b78871d0bcfeaca3..20b0506b577b3ea0b730a3c29d508afe6d4c2956 100644 (file)
@@ -216,6 +216,10 @@ end
 -- @return the remote url, false on error
 -- @return an error object on failure
 function cache.remote_url(c, server, location)
+    assert(type(c) == "table", "cache invalid")
+    assert(type(server) == "string" and server ~= "", "server invalid")
+    assert(type(location) == "string" and location ~= "", "location invalid")
+
     local ce, e = cache.ce_by_server(c, server)
     if not ce then
         return false, e