luci-app-olsr: fix null pointer exception (#6778)
for some 'virtual' interfaces, there don't seem to be network status information Signed-off-by: Andreas Bräu <ab@andi95.de>
This commit is contained in:
parent
bc61273586
commit
87da3275ea
1 changed files with 4 additions and 4 deletions
|
@ -198,13 +198,13 @@ return view.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var hosthints = await network.getHostHints();
|
var hosthints = await network.getHostHints();
|
||||||
var interfac = await network.getStatusByAddress(v.localIP);
|
var networkStatus = await network.getStatusByAddress(v.localIP);
|
||||||
var lmac = await hosthints.getMACAddrByIPAddr(v.localIP);
|
var lmac = await hosthints.getMACAddrByIPAddr(v.localIP);
|
||||||
var rmac = await hosthints.getMACAddrByIPAddr(v.remoteIP);
|
var rmac = await hosthints.getMACAddrByIPAddr(v.remoteIP);
|
||||||
|
|
||||||
for (let i = 0; i < assoclist.length; i++) {
|
for (let i = 0; i < assoclist.length; i++) {
|
||||||
var val = assoclist[i];
|
var val = assoclist[i];
|
||||||
if (val.network === interfac.interface && val.list) {
|
if (networkStatus != undefined && val.network === networkStatus.interface && val.list) {
|
||||||
for (var assocmac in val.list) {
|
for (var assocmac in val.list) {
|
||||||
var assot = val.list[assocmac];
|
var assot = val.list[assocmac];
|
||||||
if (rmac == assot.mac) {
|
if (rmac == assot.mac) {
|
||||||
|
@ -216,8 +216,8 @@ return view.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (interfac) {
|
if (networkStatus) {
|
||||||
v.interface = interfac;
|
v.interface = networkStatus;
|
||||||
}
|
}
|
||||||
v.snr = snr || null;
|
v.snr = snr || null;
|
||||||
v.signal = signal || null;
|
v.signal = signal || null;
|
||||||
|
|
Loading…
Reference in a new issue