Skip to content

Commit 2e7b35d

Browse files
committed
Improve: Handle null values on tag list
Signed-off-by: Ricardo Ruiz Saiz <dorm.std@gmail.com>
1 parent fbced45 commit 2e7b35d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

CKAN_API_Handler/src/main/java/net/atos/qrowd/handlers/CKAN_API_Handler.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ public void createPackage(String package_id, String tags) throws IOException{
173173
String line;
174174

175175
//Split <tags> by "," and for each element in the list generate a tag
176-
176+
if(tags==null)
177+
{
178+
tags="";
179+
}
177180
String[] tagList = tags.split(",");
178181
List<Tag> list = new ArrayList<>();
179182
for(String tag: tagList)
@@ -234,7 +237,10 @@ public void createPackage(String package_id, String tags) throws IOException{
234237
public void createPackagePojoNoResources(Package_ dataset, String name, String tags) throws IOException{
235238

236239
//Split <tags> by "," and for each element in the list generate a tag
237-
240+
if(tags==null)
241+
{
242+
tags="";
243+
}
238244
String[] tagList = tags.split(",");
239245
List<Tag> list = new ArrayList<>();
240246
for(String tag: tagList)

0 commit comments

Comments
 (0)