Skip to content

Commit 9f9c257

Browse files
authored
Add null check for manager (#5799)
1 parent f190d10 commit 9f9c257

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/io/flutter/FlutterUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ public static boolean isInTestDir(@Nullable DartFile file) {
219219
}
220220

221221
private static boolean isInTestOrSourceRoot(Module module, @NotNull DartFile file) {
222-
final ContentEntry[] entries = ModuleRootManager.getInstance(module).getContentEntries();
222+
final ModuleRootManager manager = ModuleRootManager.getInstance(module);
223+
if (manager == null) {
224+
return false;
225+
}
226+
final ContentEntry[] entries = manager.getContentEntries();
223227
final VirtualFile virtualFile = file.getContainingFile().getVirtualFile();
224228
boolean foundSourceRoot = false;
225229
for (ContentEntry entry : entries) {

0 commit comments

Comments
 (0)