Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2933 from nschonni/fix--Error-on-empty-min/max-call
Browse files Browse the repository at this point in the history
fix: Error on empty min/max call
  • Loading branch information
mgreter authored Jul 15, 2019
2 parents 2c22d56 + 948f126 commit ac338df
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/fn_numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ namespace Sass {
{
List* arglist = ARG("$numbers", List);
Number_Obj least;
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
size_t L = arglist->length();
if (L == 0) {
error("At least one argument must be passed.", pstate, traces);
}
for (size_t i = 0; i < L; ++i) {
Expression_Obj val = arglist->value_at_index(i);
Number_Obj xi = Cast<Number>(val);
if (!xi) {
Expand All @@ -123,7 +127,11 @@ namespace Sass {
{
List* arglist = ARG("$numbers", List);
Number_Obj greatest;
for (size_t i = 0, L = arglist->length(); i < L; ++i) {
size_t L = arglist->length();
if (L == 0) {
error("At least one argument must be passed.", pstate, traces);
}
for (size_t i = 0; i < L; ++i) {
Expression_Obj val = arglist->value_at_index(i);
Number_Obj xi = Cast<Number>(val);
if (!xi) {
Expand Down

0 comments on commit ac338df

Please sign in to comment.