Skip to content

Commit

Permalink
prevent label (filename) from being null #6821
Browse files Browse the repository at this point in the history
The getOriginalFileName method only works on tabular files so call it
early before the file becomes non-tabular.
  • Loading branch information
pdurbin committed Apr 15, 2020
1 parent 75f3b69 commit b19353d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
if (!uningest.isTabularData()) {
throw new IllegalCommandException("UningestFileCommand called on a non-tabular data file (id="+uningest.getId()+")", this);
}


String originalFileName = uningest.getOriginalFileName();

StorageIO<DataFile> dataAccess = null;
// size of the stored original:
Long storedOriginalFileSize;
Expand Down Expand Up @@ -139,7 +141,6 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
// could be more than one:

// String originalExtension = FileUtil.generateOriginalExtension(originalFileFormat);
String originalFileName = uningest.getOriginalFileName();
for (FileMetadata fm : uningest.getFileMetadatas()) {

fm.setLabel(originalFileName);
Expand Down

0 comments on commit b19353d

Please sign in to comment.