Skip to content

Commit c09c068

Browse files
committed
Fix opening MetadataAsSource files
1 parent bdab719 commit c09c068

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,7 @@ public async Task SetSharpIdeFile(SharpIdeFile file, SharpIdeFileLinePosition? f
329329
var readFileTask = _openTabsFileManager.GetFileTextAsync(file);
330330
_currentFile.FileContentsChangedExternally.Subscribe(OnFileChangedExternally);
331331
_currentFile.FileDeleted.Subscribe(OnFileDeleted);
332-
var project = Solution!.GetProjectForContainingFolderPath(_currentFile.GetContainingProjectFolder()!);
333-
if (project is not null)
332+
if (_currentFile.GetContainingProjectFolder() is {} containingProjectFolder && Solution!.GetProjectForContainingFolderPath(containingProjectFolder) is {} project)
334333
{
335334
_projectDiagnosticsObserveDisposable = project.Diagnostics.ObserveChanged().SubscribeOnThreadPool().ObserveOnThreadPool()
336335
.SubscribeAwait(async (innerEvent, ct) =>

0 commit comments

Comments
 (0)