mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Fix crash in language server
This commit is contained in:
parent
b3783b9c6a
commit
8cf793023d
2 changed files with 4 additions and 2 deletions
|
@ -57,7 +57,8 @@ class GtkDirective(AstNode):
|
|||
# validate the GTK version first to make sure the more specific error
|
||||
# message is emitted
|
||||
self.gtk_version()
|
||||
return gir.get_namespace("Gtk", self.tokens["version"])
|
||||
if self.tokens["version"] is not None:
|
||||
return gir.get_namespace("Gtk", self.tokens["version"])
|
||||
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
|
|
|
@ -45,7 +45,8 @@ class UI(AstNode):
|
|||
self._gir_errors = []
|
||||
|
||||
try:
|
||||
gir_ctx.add_namespace(self.children[GtkDirective][0].gir_namespace)
|
||||
if gtk := self.children[GtkDirective][0].gir_namespace:
|
||||
gir_ctx.add_namespace(gtk)
|
||||
except CompileError as e:
|
||||
self._gir_errors.append(e)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue