The problem for China with a rogue state like North Korea is that Beijing is a lot closer to Pyongyang than any city in the United States.  And if North Korea is capable of building a missile that can reach Beijing.

So Beijing is kind of stuck between a rock and a hard place.  On the one hand, they need to prop up a client state that is right on their doorstep.  On the other hand, the client state could do to China what said client state keeps threatening to do to the United States.

The Great Wall wasn't all that effective in keeping out the Mongol hordes.  It will be even less effective at keeping out North Korean nukes.