Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
9f81d58c
Unverified
Commit
9f81d58c
authored
Mar 02, 2023
by
zhanws
Committed by
GitHub
Mar 02, 2023
Browse files
Update WxStorageController.java (#530)
解决litemallStorage有可能返回null值,会造成异常
parent
5d144ee9
Changes
1
Hide whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxStorageController.java
View file @
9f81d58c
...
@@ -66,7 +66,7 @@ public class WxStorageController {
...
@@ -66,7 +66,7 @@ public class WxStorageController {
@GetMapping
(
"/fetch/{key:.+}"
)
@GetMapping
(
"/fetch/{key:.+}"
)
public
ResponseEntity
<
Resource
>
fetch
(
@PathVariable
String
key
)
{
public
ResponseEntity
<
Resource
>
fetch
(
@PathVariable
String
key
)
{
LitemallStorage
litemallStorage
=
litemallStorageService
.
findByKey
(
key
);
LitemallStorage
litemallStorage
=
litemallStorageService
.
findByKey
(
key
);
if
(
key
==
null
)
{
if
(
litemallStorage
==
null
||
key
==
null
)
{
return
ResponseEntity
.
notFound
().
build
();
return
ResponseEntity
.
notFound
().
build
();
}
}
if
(
key
.
contains
(
"../"
))
{
if
(
key
.
contains
(
"../"
))
{
...
@@ -91,7 +91,7 @@ public class WxStorageController {
...
@@ -91,7 +91,7 @@ public class WxStorageController {
@GetMapping
(
"/download/{key:.+}"
)
@GetMapping
(
"/download/{key:.+}"
)
public
ResponseEntity
<
Resource
>
download
(
@PathVariable
String
key
)
{
public
ResponseEntity
<
Resource
>
download
(
@PathVariable
String
key
)
{
LitemallStorage
litemallStorage
=
litemallStorageService
.
findByKey
(
key
);
LitemallStorage
litemallStorage
=
litemallStorageService
.
findByKey
(
key
);
if
(
key
==
null
)
{
if
(
litemallStorage
==
null
||
key
==
null
)
{
return
ResponseEntity
.
notFound
().
build
();
return
ResponseEntity
.
notFound
().
build
();
}
}
if
(
key
.
contains
(
"../"
))
{
if
(
key
.
contains
(
"../"
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment