How? nailgun? pushed the safety back on it? and pop!?

You nailed it! He pulled back the safety while he had his finger on the trigger. Actually a good method of nail guns is to hold the trigger and just bump the gun nose into where ever you need a nail.