Explorar el Código

CSV import web service - cosmetics on the reporting in case the data set is empty

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1067 a333f486-631f-4898-b8df-5754b55c2be0
romainq hace 14 años
padre
commit
7d7df14fc4
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      webservices/import.php

+ 5 - 0
webservices/import.php

@@ -259,6 +259,11 @@ try
 	//
 	//
 	// Check parameters format/consistency
 	// Check parameters format/consistency
 	//
 	//
+	if (strlen($sCSVData) == 0)
+	{
+		throw new ExchangeException("Missing data - at least one line is expected");
+	}
+
 	if (!MetaModel::IsValidClass($sClass))
 	if (!MetaModel::IsValidClass($sClass))
 	{
 	{
 		throw new BulkLoadException("Unknown class: '$sClass'");
 		throw new BulkLoadException("Unknown class: '$sClass'");