Commit 4a5dbd502d28bb4af3712f59c15fc566983656a5
1 parent
526082bc
Exists in
master
and in
1 other branch
Fixing string attribute behavior when the lib3270's response is "null".
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
client/src/session/local/attribute.cc
| ... | ... | @@ -196,11 +196,15 @@ |
| 196 | 196 | |
| 197 | 197 | get.asString = [](const Attribute & attr, const void *worker) { |
| 198 | 198 | |
| 199 | + errno = 0; | |
| 200 | + | |
| 199 | 201 | const struct Worker * w = (const struct Worker *) worker; |
| 200 | 202 | const char * str = w->methods->get(w->hSession); |
| 201 | 203 | |
| 202 | 204 | if(str) { |
| 203 | 205 | return string(str); |
| 206 | + } else if(!errno) { | |
| 207 | + return string(); | |
| 204 | 208 | } |
| 205 | 209 | throw std::system_error(errno, std::system_category()); |
| 206 | 210 | ... | ... |