Commit 2010582
committed
ResponseStatusExceptionFilter: Fix unwrap of JSON message
Reading the entity stream a second time without resetting it was causing
the ObjectMapper to return null then a NullPointerExceptions when
calling get('message') method on it.
Fix the issue by creating the ObjectMapper from the String
representation of the entity stream instead of resetting the stream to
read it a second time. Also check to make sure the returned JsonNode is
not null and that the content is text.
Closes #12221 parent 5c3ba9a commit 2010582
File tree
1 file changed
+15
-5
lines changed- src/main/java/com/github/dockerjava/jaxrs/filter
1 file changed
+15
-5
lines changedLines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | | - | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
| |||
0 commit comments