Skip to content

Commit e06ad94

Browse files
authored
Merge pull request #319 from stefano-m/wrap_assert_gi_require
Wrap gi.require with assert in class.lua and ffi.lua
2 parents 700fcda + 5233d83 commit e06ad94

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lgi/class.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ local component = require 'lgi.component'
2020
local record = require 'lgi.record'
2121
local ffi = require 'lgi.ffi'
2222
local ti = ffi.types
23-
local GObject = gi.require 'GObject'
23+
local GObject = assert(gi.require('GObject'))
2424

2525
-- Implementation of class and interface component loading.
2626
local class = {

lgi/ffi.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ local record = require 'lgi.record'
2121

2222
local ffi = {}
2323

24-
local gobject = gi.require('GObject')
25-
local glib = gi.require('GLib')
24+
local gobject = assert(gi.require('GObject'))
25+
local glib = assert(gi.require('GLib'))
2626

2727
-- Gather all basic types. We have to 'steal' them from well-known
2828
-- declarations, because girepository API does not allow synthesizing

0 commit comments

Comments
 (0)