Explorar el Código

Return nothing gracefully if no sequence is provided

Alois Mahdal hace 3 años
padre
commit
d584e65b5e
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1
    0
      src/imapdomo.lua

+ 1
- 0
src/imapdomo.lua Ver fichero

@@ -207,6 +207,7 @@ pkg.head = function(num, seq)
207 207
     --
208 208
     -- Return first *num* elements from sequence
209 209
     --
210
+    if not seq then return seq end
210 211
     local result = seq:is_smaller(0)    -- HACK to generate empty sequence
211 212
     for idx, value in ipairs(seq) do
212 213
         if idx > num then break end