We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2ab7eb commit 70e4e40Copy full SHA for 70e4e40
1 file changed
lib/vix/vips/image.ex
@@ -1548,7 +1548,7 @@ defmodule Vix.Vips.Image do
1548
!is_list(list) ->
1549
{:error, "argument is not a list"}
1550
1551
- length(list) > 0 && is_list(hd(list)) ->
+ non_empty_list?(list) && is_list(hd(list)) ->
1552
height = length(list)
1553
width = length(hd(list))
1554
@@ -1574,6 +1574,9 @@ defmodule Vix.Vips.Image do
1574
end
1575
1576
1577
+ defp non_empty_list?([]), do: false
1578
+ defp non_empty_list?(_list), do: true
1579
+
1580
defp validate_list_dimension(width, height, list) do
1581
if length(list) == width * height do
1582
:ok
0 commit comments