Coverity - accessing attribute of variable which can point to null

Added check whether variable is pointing to null or not.

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Pavel Vomacka 2016-07-26 13:07:30 +02:00 committed by Petr Vobornik
parent cd74f78ed7
commit aa8a904c4a

View File

@ -4939,7 +4939,7 @@ IPA.combobox_widget = function(spec) {
var value = that.list.val();
var option = $('option[value="'+value+'"]', that.list);
var next = option.next();
if (!next.length) return;
if (!next || !next.length) return;
that.select(next.val());
};
@ -4947,7 +4947,7 @@ IPA.combobox_widget = function(spec) {
var value = that.list.val();
var option = $('option[value="'+value+'"]', that.list);
var prev = option.prev();
if (!prev.length) return;
if (!prev || !prev.length) return;
that.select(prev.val());
};