Changeset 7005

Show
Ignore:
Timestamp:
04/28/11 11:27:00 (2 years ago)
Author:
jow
Message:

applications/luci-vnstat: fix crash if dbdir is defined but not existing yet

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua

    r6735 r7005  
    3838local iface 
    3939 
    40 for iface in fs.dir(dbdir) do 
    41     if iface:sub(1,1) ~= '.' then 
    42         ifaces[iface] = iface 
    43         enabled[iface] = iface 
     40if fs.access(dbdir) then 
     41    for iface in fs.dir(dbdir) do 
     42        if iface:sub(1,1) ~= '.' then 
     43            ifaces[iface] = iface 
     44            enabled[iface] = iface 
     45        end 
    4446    end 
    4547end