mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 14:32:24 +00:00
Allow responses with no "type" field to succeed for ServiceExtensionConsumers.
Change-Id: If7f239c67e54330e77e805dd2375bbfba1dbd76c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117441 Reviewed-by: Devon Carew <devoncarew@google.com> Commit-Queue: Kenzie Schmoll <kenzieschmoll@google.com>
This commit is contained in:
parent
e00c8f3cb7
commit
9753a397bf
1 changed files with 6 additions and 4 deletions
|
@ -618,11 +618,13 @@ abstract class VmServiceBase implements VmServiceConst {
|
|||
Logging.getLogger().logError("Response has invalid " + RESULT, e);
|
||||
return;
|
||||
}
|
||||
String responseType;
|
||||
try {
|
||||
String responseType = "";
|
||||
if (result.has(TYPE)) {
|
||||
responseType = result.get(TYPE).getAsString();
|
||||
} catch (Exception e) {
|
||||
Logging.getLogger().logError("Response missing " + TYPE, e);
|
||||
}
|
||||
// ServiceExtensionConsumers do not care about the response type.
|
||||
else if (!(consumer instanceof ServiceExtensionConsumer)) {
|
||||
Logging.getLogger().logError("Response missing " + TYPE + ": " + result.toString());
|
||||
return;
|
||||
}
|
||||
forwardResponse(consumer, responseType, result);
|
||||
|
|
Loading…
Reference in a new issue