1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

LanguageServers: Fix incorrect use of adopt_ref in FileDB::get()

This fixes a bug introduced in c13d763 that caused the LanguageServer
process to crash whenever a file was edited in HackStudio.
This commit is contained in:
Itamar 2021-05-09 19:49:02 +03:00 committed by Andreas Kling
parent dc9995a5ba
commit de9be7cd70

View file

@ -19,7 +19,7 @@ RefPtr<const GUI::TextDocument> FileDB::get(const String& filename) const
if (!document_optional.has_value())
return nullptr;
return adopt_ref(*document_optional.value());
return *document_optional.value();
}
RefPtr<GUI::TextDocument> FileDB::get(const String& filename)