Thumbs down Battery Pull then Corrupt SD Card

My battery in my S4 was almost dead so I went to swap it with a charged one. I didn't shutdown the phone, I just pulled the battery and put in the new one.

After my phone restarted I got a bad SD card notification. I pulled the SD card and tried to read it with 2 different computers and both times Windows said I needed to format before using...

I ended up formatting it with Windows and running a card recovery program to get most of my photos back. Now I have to deal with downloading all my music from Google Play again and replacing all the other files I had on there. The SD card does work normally but it was a pain in the ass.

So moral of the story, shutdown your phone before pulling the battery, because your phone just might be accessing your SD card when you do it.