File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public Object upload(@RequestParam("file") MultipartFile file) throws IOExceptio
6666 @ GetMapping ("/fetch/{key:.+}" )
6767 public ResponseEntity <Resource > fetch (@ PathVariable String key ) {
6868 LitemallStorage litemallStorage = litemallStorageService .findByKey (key );
69- if (key == null ) {
69+ if (litemallStorage == null || key == null ) {
7070 return ResponseEntity .notFound ().build ();
7171 }
7272 if (key .contains ("../" )) {
@@ -91,7 +91,7 @@ public ResponseEntity<Resource> fetch(@PathVariable String key) {
9191 @ GetMapping ("/download/{key:.+}" )
9292 public ResponseEntity <Resource > download (@ PathVariable String key ) {
9393 LitemallStorage litemallStorage = litemallStorageService .findByKey (key );
94- if (key == null ) {
94+ if (litemallStorage == null || key == null ) {
9595 return ResponseEntity .notFound ().build ();
9696 }
9797 if (key .contains ("../" )) {
You can’t perform that action at this time.
0 commit comments