Diversification MMM

I’ve currently got a share in GD, Was thinking of Putting some into MMM aswell, I noticed they’re both in the Capital Goods Industry but different sectors, Is it a safe idea to have two companies in the same industry if they have different Sectors? Just want to be sure that Putting into MMM won’t affect GD Negatively cuz they’re the same industry