File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
flutter-idea/src/io/flutter/pub Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ public String getRelativePath(@NotNull VirtualFile file) {
177177 return path .substring (root .length () + 1 );
178178 }
179179
180- private static final String /* @NotNull*/ [] TEST_DIRS = new String []{ // TODO 2022.1
180+ private static final String @ NotNull [] TEST_DIRS = new String []{ // TODO 2022.1
181181 "/test/" ,
182182 "/integration_test/" ,
183183 "/test_driver/" ,
@@ -237,6 +237,7 @@ public VirtualFile getPubspec() {
237237 */
238238 public boolean declaresFlutter () {
239239 validateUpdateCachedPubspecInfo ();
240+ assert cachedPubspecInfo != null ;
240241 return cachedPubspecInfo .declaresFlutter ();
241242 }
242243
@@ -444,7 +445,10 @@ public Module getModule(@NotNull Project project) {
444445 if (project .isDisposed ()) {
445446 return null ;
446447 }
447- return ProjectRootManager .getInstance (project ).getFileIndex ().getModuleForFile (pubspec );
448+ var manager = ProjectRootManager .getInstance (project );
449+ if (manager == null ) return null ;
450+
451+ return manager .getFileIndex ().getModuleForFile (pubspec );
448452 }
449453
450454 @ Override
You can’t perform that action at this time.
0 commit comments