Skip to content

NullRef in AbstractSyncNamespaceCodeRefactoringProvider.State.cs#L161 #60270

@KirillOsenkov

Description

@KirillOsenkov

return PathUtilities.PathsEqual(absoluteDircetoryPath, logicalDirectoryPath);

also note the misspelling:
absoluteDircetoryPath

System.NullReferenceException: Object reference not set to an instance of an object.
   at bool Roslyn.Utilities.PathUtilities.PathsEqual(string path1, string path2) in C:/Roslyn/src/Compilers/Core/Portable/FileSystem/PathUtilities.cs:line 642
   at bool Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax>+State.IsDocumentPathRootedInProjectFolder(Document document) in C:/Roslyn/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.State.cs:line 158
   at async Task<State> Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax>+State.CreateAsync(AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax> provider, Document document, TextSpan textSpan, CancellationToken cancellationToken) in C:/Roslyn/src/Features/Core/Portable/CodeRefactorings/SyncNamespace/AbstractSyncNamespaceCodeRefactoringProvider.State.cs:line 99
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<State> Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax>+State.CreateAsync(AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax> provider, Document document, TextSpan textSpan, CancellationToken cancellationToken)
   at async Task Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax>.ComputeRefactoringsAsync(CodeRefactoringContext context)
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task Microsoft.CodeAnalysis.CodeRefactorings.SyncNamespace.AbstractSyncNamespaceCodeRefactoringProvider<TNamespaceDeclarationSyntax, TCompilationUnitSyntax, TMemberDeclarationSyntax>.ComputeRefactoringsAsync(CodeRefactoringContext context)
   at async Task<CodeRefactoring> Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(Document document, TextSpan state, CodeRefactoringProvider provider, CodeChangeProviderMetadata providerMetadata, IExtensionManager extensionManager, bool isBlocking, CancellationToken cancellationToken) in C:/Roslyn/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs:line 182
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<CodeRefactoring> Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(Document document, TextSpan state, CodeRefactoringProvider provider, CodeChangeProviderMetadata providerMetadata, IExtensionManager extensionManager, bool isBlocking, CancellationToken cancellationToken)
   at async Task<bool> Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.HasRefactoringsAsync(Document document, TextSpan state, CancellationToken cancellationToken) in C:/Roslyn/src/Features/Core/Portable/CodeRefactorings/CodeRefactoringService.cs:line 96
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<bool> Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.HasRefactoringsAsync(Document document, TextSpan state, CancellationToken cancellationToken)
   at async Task<string> Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionsSourceProvider+SuggestedActionsSource.TryGetRefactoringSuggestedActionCategoryAsync(Document document, TextSpan? selection, CancellationToken cancellationToken)
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<string> Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionsSourceProvider+SuggestedActionsSource.TryGetRefactoringSuggestedActionCategoryAsync(Document document, TextSpan? selection, CancellationToken cancellationToken)
   at Task<ISuggestedActionCategorySet> Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionsSourceProvider+SuggestedActionsSource.GetSuggestedActionCategoriesAsync(ISuggestedActionCategorySet requestedActionCategories, SnapshotSpan range, CancellationToken cancellationToken)+() => { } in C:/Roslyn/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs:line 624

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions