@ -1531,6 +1531,7 @@ static const LuaWrapper::FunctionReg dfhack_units_module[] = {
WRAPM(Units, getCasteProfessionName),
WRAPM(Units, getProfessionColor),
WRAPM(Units, getCasteProfessionColor),
WRAPM(Units, getSquadName),
WRAPM(Units, isWar),
WRAPM(Units, isHunter),
WRAPM(Units, isAvailableForAdoption),
@ -1799,6 +1799,7 @@ int8_t Units::getCasteProfessionColor(int race, int casteid, df::profession pid)
std::string Units::getSquadName(df::unit *unit)
{
CHECK_NULL_POINTER(unit);
if (unit->military.squad_id == -1)
return "";
df::squad *squad = df::squad::find(unit->military.squad_id);