Browse Source

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 14 years ago
parent
commit
7d7df14fc4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      webservices/import.php

+ 5 - 0
webservices/import.php

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