# HG changeset patch # User Kim Alvefur # Date 1751538452 -7200 # Node ID e174e12549e1db5ae0e1954899ed55f30e5a2988 # Parent ebcf612da2b1f5a85f73c01219ee2db9627e6f2b mod_http_oauth2: Handle absent array argument in array member check Allows this argument to be optional and prevents an error attempting to obtain the length of nil. diff -r ebcf612da2b1 -r e174e12549e1 mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Thu Jul 03 12:14:53 2025 +0200 +++ b/mod_http_oauth2/mod_http_oauth2.lua Thu Jul 03 12:27:32 2025 +0200 @@ -29,6 +29,9 @@ end local function array_contains(haystack, needle) + if not haystack then + return false + end for i = 1, #haystack do if haystack[i] == needle then return true