File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
flutter-idea/src/io/flutter/pub Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ public static PubRoot forDirectory(@Nullable VirtualFile dir) {
153153 */
154154 @ Nullable
155155 public static PubRoot forDirectoryWithRefresh (@ NotNull VirtualFile dir ) {
156- // Ensure file existence and timestamps are up to date.
156+ // Ensure file existence and timestamps are up-to- date.
157157 dir .refresh (false , false );
158158
159159 return forDirectory (dir );
@@ -342,11 +342,10 @@ public VirtualFile getFileToOpen() {
342342 if (main != null ) {
343343 return main ;
344344 }
345-
346345 final VirtualFile lib = getLib ();
347346 if (lib != null ) {
348347 final VirtualFile [] files = lib .getChildren ();
349- if (files .length != 0 ) {
348+ if (files != null && files .length != 0 ) {
350349 return files [0 ];
351350 }
352351 }
@@ -365,6 +364,7 @@ public VirtualFile getLibMain() {
365364 /**
366365 * Returns example/lib/main.dart if it exists.
367366 */
367+ @ Nullable
368368 public VirtualFile getExampleLibMain () {
369369 final VirtualFile exampleDir = root .findChild ("example" );
370370 if (exampleDir != null ) {
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public List<PubRoot> getRoots(@NotNull Project project) {
9090 }
9191
9292 @ Nullable
93- private VirtualFile findPubspecDir (VirtualFile file ) {
93+ private VirtualFile findPubspecDir (@ Nullable VirtualFile file ) {
9494 if (file == null ) {
9595 return null ;
9696 }
You can’t perform that action at this time.
0 commit comments