Skip to content

Commit

Permalink
Release v0.8.3
Browse files Browse the repository at this point in the history
Catch exception inside the `check_dependency` function if require fails
  • Loading branch information
Kiougar committed Feb 7, 2019
1 parent b3e6eed commit b4b09e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CONTROL/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: luci-wrtbwmon
Version: 0.8.2
Version: 0.8.3
Depends: luci, wrtbwmon
Architecture: all
Maintainer: Georgios Tzourmpakis <kiougar@gmail.com>
Expand Down
3 changes: 2 additions & 1 deletion luci-wrtbwmon/luasrc/controller/wrtbwmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ end

function check_dependency()
local ret = "0"
if require("luci.model.ipkg").installed('wrtbwmon') then
local status, ipkg = pcall(require, "luci.model.ipkg")
if not status or ipkg.installed('wrtbwmon') then
ret = "1"
end
luci.http.prepare_content("text/plain")
Expand Down

0 comments on commit b4b09e3

Please sign in to comment.