mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Changes from last FF push
This commit is contained in:
parent
0c9238651a
commit
08c5c38c7b
@ -2019,15 +2019,21 @@ end
|
|||||||
|
|
||||||
--- Ensure the passed object is a table.
|
--- Ensure the passed object is a table.
|
||||||
-- @param #table Object The object that should be a table.
|
-- @param #table Object The object that should be a table.
|
||||||
-- @return #table The object that is a table. Note that if the Object is `#nil` initially, and empty table `{}` is returned.
|
-- @param #boolean ReturnNil If `true`, return `#nil` if `Object` is nil. Otherwise an empty table `{}` is returned.
|
||||||
function UTILS.EnsureTable(Object)
|
-- @return #table The object that now certainly *is* a table.
|
||||||
|
function UTILS.EnsureTable(Object, ReturnNil)
|
||||||
|
|
||||||
if Object then
|
if Object then
|
||||||
if type(Object)~="table" then
|
if type(Object)~="table" then
|
||||||
Object={Object}
|
Object={Object}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Object={}
|
if ReturnNil then
|
||||||
|
return nil
|
||||||
|
else
|
||||||
|
Object={}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return Object
|
return Object
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user