WebUI - Coverity: fixed null pointer exception

The record variable could be null. This check makes sure
that variable won't be null.

Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
This commit is contained in:
Pavel Vomacka 2017-04-13 12:03:08 +02:00 committed by Martin Basti
parent b54ceae961
commit 5ba7957450

View File

@ -888,7 +888,7 @@ field.Adapter = declare(null, {
if (result) record = result[this.result_name];
var res_type = typeof record;
var obj_in_type = typeof this.object_index;
if (res_type === 'object' && obj_in_type === 'number')
if (record && res_type === 'object' && obj_in_type === 'number')
record = record[this.object_index];
}
}