y0014984 / Advanced-Equipment

Advanced Equipment is a Arma 3 mod, that brings equipment to life, like laptops and lamps.
Other
30 stars 10 forks source link

Non-reachable catch for spawn execution and obsolete _result in 'executeFile' #266

Open y0014984 opened 1 year ago

y0014984 commented 1 year ago

https://github.com/y0014984/Advanced-Equipment/blob/0bec49ca28c7d177e08c84dc74f75cd57774c90f/addons/armaos/functions/fnc_shell_executeFile.sqf

In this function all commands of armaOS are spawned. Because of spawn the catch clause will never be reached via a thrown exception from within a command. Either we only use try/catch for calling getFile or we find a way to process exceptions at this point that are thrown by a spawned function.

Additionally, the defined _result variable is not used anywhere and the calling function fnc_shell_process.sqf does not process any return values. So this line can be removed.