Bug 965346 - Part 1: Ensure that callback is called, even when reply is null. r=mrbkap

This commit is contained in:
Ted Clancy (:tedders1) 2014-02-13 08:51:12 -08:00
parent 245097b752
commit e7d1064645

View File

@ -1075,8 +1075,8 @@ var WifiManager = (function() {
manager.getConfiguredNetworks = function(callback) {
wifiCommand.listNetworks(function (reply) {
var networks = Object.create(null);
var lines = reply.split("\n");
if (lines.length === 1) {
var lines = reply ? reply.split("\n") : 0;
if (lines.length <= 1) {
// We need to make sure we call the callback even if there are no
// configured networks.
callback(networks);