Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(940)

Unified Diff: runtime/observatory/lib/src/repositories/editor.dart

Issue 3002473002: Check service availability on editor repository (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/repositories/editor.dart
diff --git a/runtime/observatory/lib/src/repositories/editor.dart b/runtime/observatory/lib/src/repositories/editor.dart
index 26395736c330a8432a716165142ca65238a9df82..80b4b624d65b5e3540c290e5783379bb1b380e31 100644
--- a/runtime/observatory/lib/src/repositories/editor.dart
+++ b/runtime/observatory/lib/src/repositories/editor.dart
@@ -17,15 +17,15 @@ class EditorRepository extends M.EditorRepository {
}
S.Service _getService() {
- if (_vm.services.isEmpty) {
- return null;
+ Iterable<M.Service> services =
+ _vm.services.where((s) => s.service == 'openSourceLocation');
+ if (_editor != null) {
+ services = services.where((s) => s.alias == _editor);
}
- if (_editor == null) {
- return _vm.services.where((s) => s.service == 'openSourceLocation').first;
+ if (services.isNotEmpty) {
+ return services.first;
}
- return _vm.services
- .where((s) => s.service == 'openSourceLocation' && s.alias == _editor)
- .single;
+ return null;
}
Future openClass(M.IsolateRef i, M.ClassRef c) async {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698