Safer FileSystemState.hasUri

SourceFactory.forUri2() can return null.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33859
Bug: https://github.com/dart-lang/sdk/issues/33233
Change-Id: I34908cd9d04050cc2afcdc716c6bb68d4f177702
Reviewed-on: https://dart-review.googlesource.com/73242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 6102bf7..b048577 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -894,7 +894,7 @@
       Source fileSource = resource.createSource();
       Uri uri = _sourceFactory.restoreUri(fileSource);
       Source uriSource = _sourceFactory.forUri2(uri);
-      flag = uriSource.fullName == path;
+      flag = uriSource?.fullName == path;
       _hasUriForPath[path] = flag;
     }
     return flag;