Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit c1936ae

Browse files
author
Mikhail Arkhipov
authored
Merge pull request #88 from MikhailArkhipov/72
Fix NullRef in module name calculation
2 parents 8524a61 + a4b3a29 commit c1936ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Analysis/Engine/Impl/ModuleResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internal static IEnumerable<string> ResolvePotentialModuleNames(
9393
string relativeModuleName,
9494
bool absoluteImports
9595
) {
96-
string importingFrom = null;
96+
string importingFrom = string.Empty;
9797
if (!string.IsNullOrEmpty(importingFromModuleName)) {
9898
importingFrom = importingFromModuleName;
9999
if (!string.IsNullOrEmpty(importingFromFilePath) && ModulePath.IsInitPyFile(importingFromFilePath)) {
@@ -149,7 +149,7 @@ bool absoluteImports
149149

150150
private static string GetModuleFullName(string originatingModule, string relativePath) {
151151
// Check if it is indeed relative
152-
if (string.IsNullOrEmpty(relativePath) || relativePath[0] != '.') {
152+
if (string.IsNullOrEmpty(originatingModule) || string.IsNullOrEmpty(relativePath) || relativePath[0] != '.') {
153153
return relativePath;
154154
}
155155

0 commit comments

Comments
 (0)