Fixed error with passing nil to unit.find

develop
AndreasPK 2014-12-12 02:47:59 +01:00
parent 10fa55570e
commit 88354c7183
1 changed files with 5 additions and 1 deletions

@ -29,7 +29,11 @@ if args.help then
return
end
unit = df.unit.find(args.unit) or dfhack.gui.getSelectedUnit()
if(args.unit) then
unit = df.unit.find(args.unit)
else
unit = dfhack.gui.getSelectedUnit()
end
if not unit then
qerror('Error: please select a unit or pass its id as an argument.')