Practical this will not happen but its better to prevent than cure. When you put tension on the strings be aware of the fact that a string could break and get in your face. After renewing strings you will have to retune your guitar a couple of days until the elasticity of the new strings is vanished. While unpacking the new strings pay attention to the fact that they can be nodded. This will create a weak spot in the string.
Nylon strings have to be knotted to the comb.
Base strings mostly have a nylon loop on one end to make it easier knotting. The lose ends remaining after knotting the string may not be too long because it could provide an annoying buzzing against the upper blade of the guitar. Fixing the string on the tune keys must happen in a way that they can't slip away.