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

Versioning - Handle non-numbers in arrays #401

Merged
merged 1 commit into from
Jun 30, 2016
Merged

Conversation

PabstMirror
Copy link
Contributor

Using strings inside the version required array causes a error
ACE[] = {"ace_common", {"3.6.0"}, "(true)"};
will cause:
Error >: Type String, expected Number,Not a Number

Which seems to cascade and break all of postInit.

Simple fix to check that the arrays are all numbers, if not it will fail the check.


//Handle non-number arrays - eg. {"mod", {"1.0"}, "(true)"}
if ((!(_value isEqualTo [])) && {!(_value isEqualTypeAll 0)}) exitWith {true};
if ((!(_localValue isEqualTo [])) && {!(_localValue isEqualTypeAll 0)}) exitWith {true};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably log an error here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And report an error. true -> false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will return true (true = failed) meaning it will report the dependency as being bad, which should be logged well enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except it's not the dependency that is bad, it's the configuration that is incorrect.

@commy2
Copy link
Contributor

commy2 commented Jun 29, 2016

My suggestion:
params ["_value","_localValue"];
->
params [["_value", [], [[]]], ["_localValue", [], [[]]]];

if !(_value isEqualTypeAll 0) exitWith {
    //log error
    false
};

if !(_localValue isEqualTypeAll 0) exitWith {
    //log error
    false
};

@commy2 commy2 added this to the 2.4.2 milestone Jun 30, 2016
@commy2 commy2 merged commit 0b22fd1 into master Jun 30, 2016
@commy2 commy2 deleted the versioningHandleStrings branch June 30, 2016 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants