Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check data type of the arguments of 'CBA_fnc_addKeybind' #484

Merged
merged 2 commits into from
Aug 30, 2016

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Aug 22, 2016

When merged this pull request will:

  • @nathan423 was using the function like this:
    ["United Operations", "Admin Console", ["player", [], -10, "_this call uo_fnc_selfInteractMenu", "main"], [DIK_APPS, [false, false, false]], false, "keydown"] call cba_fnc_addKeybind;,
    but the third argument is meant to be a string.
  • This is a really nasty error, because that array is stored in the profile and will lead to the following persistent error message:
17:05:28 Error in expression <aram [_forEachIndex, []];

_actionEntry params [["_displayName", "", ["", []]], >
17:05:28   Error position: <params [["_displayName", "", ["", []]], >
17:05:28   Error Params: Type String, expected Array
17:05:28 File x\cba\addons\help\XEH_postClientInit.sqf, line 79
  • The only way to remove this error is to clear the keybinding variable from the profile.
  • This PR makes it so the function checks the input to prevent errors like this in future.

@commy2 commy2 added this to the 3.0.1 milestone Aug 22, 2016
@PabstMirror
Copy link
Contributor

3rd arg can be array
Throws: Error Params: Type Array, expected String
But just letting it take [] for 3rd arg might not fix the problem with the bad code.

@commy2
Copy link
Contributor Author

commy2 commented Aug 22, 2016

_displayName - Pretty name, or an array of strings for the pretty name and a tool tip [String]

Oh, yeah. Missed that. Will have to do further stuff with this...

@commy2 commy2 added the WIP label Aug 22, 2016
@commy2 commy2 removed the WIP label Aug 23, 2016
@Killswitch00 Killswitch00 merged commit 369cd00 into master Aug 30, 2016
@Killswitch00 Killswitch00 deleted the check-input-addKeybind branch August 30, 2016 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants