Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 06115b7

Browse files
authored
Fix arg with null location (microsoft#1220)
1 parent 9c5cc09 commit 06115b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Analysis/Ast/Impl/Analyzer/Evaluation/ExpressionEval.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public ExpressionEval(IServiceContainer services, IPythonModule module, GlobalSc
6363
public LocationInfo GetLocationInfo(Node node) => node?.GetLocation(Module) ?? LocationInfo.Empty;
6464

6565
public Location GetLocationOfName(Node node) {
66-
node = node ?? throw new ArgumentNullException(nameof(node));
67-
if (Module.ModuleType != ModuleType.User && Module.ModuleType != ModuleType.Library) {
66+
if (node == null || (Module.ModuleType != ModuleType.User && Module.ModuleType != ModuleType.Library)) {
6867
return DefaultLocation;
6968
}
7069

0 commit comments

Comments
 (0)