sdk 修改npe问题
This commit is contained in:
@ -64,7 +64,7 @@ public class ModelConvertor {
|
||||
* @return
|
||||
*/
|
||||
public Optional<QueryResult> toQueryResult(String json) {
|
||||
return Optional.of(json).map(content -> {
|
||||
return Optional.ofNullable(json).map(content -> {
|
||||
try {
|
||||
return objectMapper.readValue(content, QueryResult.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
@ -79,7 +79,7 @@ public class ModelConvertor {
|
||||
* @return
|
||||
*/
|
||||
public Optional<byte[]> toByteArray(String json) {
|
||||
return Optional.of(json).map(content -> {
|
||||
return Optional.ofNullable(json).map(content -> {
|
||||
try {
|
||||
return tpDownPO(content).getFileStream();
|
||||
} catch (JsonProcessingException e) {
|
||||
@ -94,7 +94,7 @@ public class ModelConvertor {
|
||||
* @return
|
||||
*/
|
||||
public Optional<DownloadEntity> toDownloadEntity(String json) {
|
||||
return Optional.of(json).map(content -> {
|
||||
return Optional.ofNullable(json).map(content -> {
|
||||
DownloadEntity entity = null;
|
||||
try {
|
||||
SysStorageVO vo = tpDownPO(content);
|
||||
@ -115,7 +115,7 @@ public class ModelConvertor {
|
||||
* @return
|
||||
*/
|
||||
public Optional<UploadObject> toUploadObject(String json) {
|
||||
return Optional.of(json).map(content -> {
|
||||
return Optional.ofNullable(json).map(content -> {
|
||||
try {
|
||||
return new UploadObject().setId(toUploadPO(json).getFileId());
|
||||
} catch (JsonProcessingException e) {
|
||||
|
Reference in New Issue
Block a user