9d47270703d4b9b603127f6c41dc9f1e49b56708
angie
  Wed Apr 17 11:08:58 2019 -0700
loadAndValidateBed: Don't errAbort on empty array when checking autoSql fields; empty arrays are valid.

diff --git src/lib/basicBed.c src/lib/basicBed.c
index cb2acdc..85814cc 100644
--- src/lib/basicBed.c
+++ src/lib/basicBed.c
@@ -1660,33 +1660,33 @@
 	    else if (asTypesIsFloating(type))
 		lineFileNeedDouble(lf, row, i);
 	    else if (type == t_string)
 		{
 		if (strlen(row[i]) > 255)
 		    lineFileAbort(lf, "expecting length (%llu) of string (%s) not to exceed 255 in field %s", (unsigned long long)strlen(row[i]), row[i], asCol->name);
 		}
 	    }
 	else if (asCol->isList)
 	    {
             if (asTypesIsFloating(type))
                 {
                 // assure count = #items in list; lightweight validation (better than none)
                 int ix = asColumnFindIx(as->columnList, asCol->linkedSizeName);
                 int count = sqlUnsigned(row[ix]);
-		if (count == 0)
+		if (count < 0)
                     lineFileAbort(lf, 
-                        "expecting positive number in count field for %s list, found %d", 
+                        "expecting nonnegative number in count field for %s list, found %d",
                                         asCol->name, asCol->fixedSize);
                 int itemCount = countSeparatedItems(row[i], ',');
                 if (count != itemCount)
                     lineFileAbort(lf, "expecting %d elements in %s list, found %d", 
                                         count, asCol->name, itemCount);
                 }
 	    else if (asTypesIsInt(type))
 		{
 		count = lineFileAllIntsArray(lf, row, i, NULL, countSeparatedItems(row[i], ','),
 		    !asTypesIsUnsigned(type), asTypesIntSize(type), asTypesIntSizeDescription(type), FALSE);
 		if (asCol->fixedSize > 0)
 		    {
 		    if (asCol->fixedSize != count)
 			lineFileAbort(lf, "expecting %d elements in %s list, found %d", asCol->fixedSize, asCol->name, count);
 		    }