diff options
author | nosami <jasonimison@gmail.com> | 2019-09-18 07:11:05 +0300 |
---|---|---|
committer | nosami <jasonimison@gmail.com> | 2019-09-18 07:11:05 +0300 |
commit | 58ed05d3515e4ccbae468be397c3c6a67efcfd6f (patch) | |
tree | 49836d40f62b3e1517ce73a44f82d5ddb6471669 /main/external/fsharpbinding | |
parent | ded4d8565c44a81f594726b7a8b3e1ef41a40656 (diff) |
[F#] Fix LanguageService exception
Sometimes the Document.Editor property was null which caused
the whole project to not get parsed
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/984699
Diffstat (limited to 'main/external/fsharpbinding')
-rw-r--r-- | main/external/fsharpbinding/MonoDevelop.FSharpBinding/Services/FileService.fs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Services/FileService.fs b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Services/FileService.fs index ec6db23f23..9448ad7c49 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Services/FileService.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Services/FileService.fs @@ -16,8 +16,11 @@ type FileSystem (defaultFileSystem : IFileSystem, openDocuments: unit -> Documen let getOpenDocContent (filename: string) = match getOpenDoc filename with | Some d -> - let bytes = System.Text.Encoding.UTF8.GetBytes (d.Editor.Text) - Some bytes + match d.Editor with + | null -> None + | editor -> + let bytes = System.Text.Encoding.UTF8.GetBytes (editor.Text) + Some bytes | _ -> None static member IsAScript fileName = |