File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
PluginsAndFeatures/azure-toolkit-for-intellij/src/main/java/com/microsoft/intellij/util Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 3333import lombok .extern .slf4j .Slf4j ;
3434import org .apache .commons .lang3 .ArrayUtils ;
3535
36+ import javax .annotation .Nullable ;
3637import javax .swing .Icon ;
3738
3839import java .io .File ;
@@ -87,10 +88,15 @@ public static Module getSelectedModule() {
8788 return DataKeys .MODULE .getData (dataContext );
8889 }
8990
91+ @ Nullable
9092 public static String getModulePath (Module module ) {
91- return Optional .of (ModuleRootManager .getInstance (module ).getContentRoots ())
92- .filter (ArrayUtils ::isNotEmpty )
93- .map (array -> array [0 ].getPath ()).orElse (null );
93+ try {
94+ return Optional .of (ModuleRootManager .getInstance (module ).getContentRoots ())
95+ .filter (ArrayUtils ::isNotEmpty )
96+ .map (array -> array [0 ].getPath ()).orElse (null );
97+ } catch (Exception e ) {
98+ return null ;
99+ }
94100 }
95101
96102 /**
You can’t perform that action at this time.
0 commit comments