-
Notifications
You must be signed in to change notification settings - Fork 133
NullReferenceException getting URI absolute path in PythonModule.Definition #1018
Comments
|
Do you have repro steps? |
For I have no repro for this, unfortunately; these are pulled from telemetry. |
|
For |
How is it possible to get |
Unresolved import? |
if (analysis?.Ast == null) {
return null;
} So it won't proceed for unresolved import. |
Bunch of code checks public IPythonModule SpecializeModule(string name, Func<string, IPythonModule> specializationConstructor) {
var import = CurrentPathResolver.GetModuleImportFromModuleName(name);
var module = specializationConstructor(import?.ModulePath);
_specialized[name] = module;
return module;
} |
|
Technically yes
such as we didn't find |
And in public Uri Uri => Module?.Uri; |
Then we should probably fail in this place: if module path isn't found, there is no reason to specialize it. |
But this public PythonVariableModule(string name, IPythonInterpreter interpreter)
: base(PythonMemberType.Module) {
Name = name;
Interpreter = interpreter;
SetDeclaringModule(this);
} called from private PythonVariableModule GetOrCreateVariableModule(in string fullName, in PythonVariableModule parentModule, in string memberName) {
if (_variableModules.TryGetValue(fullName, out var variableModule)) {
return variableModule;
}
variableModule = new PythonVariableModule(fullName, Interpreter); creates module with no |
|
Fix is likely one of:
Uri?.ToAbsolutePath()
;LocationInfo.FilePath
is only ever used for comparison and is allowed to be null.PythonModule.FilePath
instead of convertingUri
.The text was updated successfully, but these errors were encountered: