Skip to content

Commit

Permalink
Fix bug related with null value of file type and thumbnail while impo…
Browse files Browse the repository at this point in the history
…rting
  • Loading branch information
zHd4 committed Jan 20, 2025
1 parent 05a6e4e commit a81a31d
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,21 @@ protected void parseFileInfoObject(FileInfo fileInfo) throws IOException {
}

case "type" -> {
if (parser.getValueAsString().equals("type")) continue;
fileInfo.setType(parser.getValueAsString());
String value = parser.getValueAsString();

if (value != null) {
if (value.equals("type")) continue;
fileInfo.setType(parser.getValueAsString());
}
}

case "thumbnail" -> {
if (parser.getValueAsString().equals("thumbnail")) continue;
fileInfo.setThumbnail(parser.getBinaryValue());
String value = parser.getValueAsString();

if (value != null) {
if (value.equals("thumbnail")) continue;
fileInfo.setThumbnail(parser.getBinaryValue());
}
}

case "created_at" -> {
Expand All @@ -115,8 +123,7 @@ protected void parseFileInfoObject(FileInfo fileInfo) throws IOException {
);
}

default -> {
}
default -> {}
}
}
}
Expand Down

0 comments on commit a81a31d

Please sign in to comment.