Skip to content

Commit

Permalink
Fix error on undefined item classname
Browse files Browse the repository at this point in the history
  • Loading branch information
SzwedzikPL authored and Brett committed May 29, 2020
1 parent 67cdc00 commit 277a378
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions addons/ui/fnc_initDisplayInventory.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,18 @@ if !(isNil QGVAR(renamedItems)) then {
if (ctrlShown _control) then {
for [{_i = 0}, {_i < (lbSize _control)}, {_i = _i + 1}] do {
private _classname = ([_control, _i] call FUNC(getInventoryItemData)) select 0;
private _renameParams = GVAR(renamedItems) getVariable [_classname, []];

if !(_renameParams isEqualTo []) then {
_renameParams params ["_name", "_picture"];

if !(_name isEqualTo "") then {
_control lbSetText [_i, _name];
};
if !(_picture isEqualTo "") then {
_control lbSetPicture [_i, _picture];
if !(isNil "_classname") then {
private _renameParams = GVAR(renamedItems) getVariable [_classname, []];

if !(_renameParams isEqualTo []) then {
_renameParams params ["_name", "_picture"];

if !(_name isEqualTo "") then {
_control lbSetText [_i, _name];
};
if !(_picture isEqualTo "") then {
_control lbSetPicture [_i, _picture];
};
};
};
};
Expand Down

0 comments on commit 277a378

Please sign in to comment.