| Index: pkg/analysis_server/test/mocks.dart
|
| diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
|
| index a27a3e2a4c1d8300c4a99b4a1f1271c802e42a70..917da7e29a9daa4fce0e0ce0d8d2a2ea3f0370dc 100644
|
| --- a/pkg/analysis_server/test/mocks.dart
|
| +++ b/pkg/analysis_server/test/mocks.dart
|
| @@ -245,18 +245,22 @@ class _IsResponseSuccess extends Matcher {
|
| @override
|
| bool matches(item, Map matchState) {
|
| Response response = item;
|
| - return response.id == _id && response.error == null;
|
| + return response != null && response.id == _id && response.error == null;
|
| }
|
|
|
| @override
|
| Description describeMismatch(item, Description mismatchDescription,
|
| Map matchState, bool verbose) {
|
| Response response = item;
|
| - var id = response.id;
|
| - RequestError error = response.error;
|
| - mismatchDescription.add('has identifier "$id"');
|
| - if (error != null) {
|
| - mismatchDescription.add(' and has error $error');
|
| + if (response == null) {
|
| + mismatchDescription.add('is null response');
|
| + } else {
|
| + var id = response.id;
|
| + RequestError error = response.error;
|
| + mismatchDescription.add('has identifier "$id"');
|
| + if (error != null) {
|
| + mismatchDescription.add(' and has error $error');
|
| + }
|
| }
|
| return mismatchDescription;
|
| }
|
|
|