why module.getModuleFile return null
Answered
call method com.intellij.openapi.module.impl.ModuleImpl#getModuleFile , follow the code to com.intellij.openapi.vfs.impl.FilePartNode#myFile(java.lang.Object), the parameter is .iml file path, then return null. same call before run well.
Please sign in to leave a comment.
Hi,
Looking at the
com.intellij.openapi.vfs.impl.FilePartNode#myFile(java.lang.Object)
method it's impossible that it returned aVirtualFile
instance for path parameter as it returns non-null values only when parameter isVirtualFile
:Maybe two calls were done from different contexts. Could you please provide us with the more information about the issue? Where do you call
module.getModuleFile()
from?Please also consider cases mentioned in com.intellij.openapi.module.Module#getModuleFile javadoc. Note this is Internal API and should not be used by 3rd party plugins. See javadoc for alternatives.