You are not alone; lots of other people in our Ummah feel the same way. It shows that you are attached to our community and are concerned with anything that may damage its reputation. Try to take some time to really understand why you are feeling the way you do when you hear of a terrorist attack. Clearly understand what you are really dreading. Is it public opinion? Is it the reaction of your friend? Once you’ve isolated the specific reason of your dread, think deeply about the parts which you can control, and those parts which you cannot. Focus your energies and emotions on the aspects that you can control and consciously let go of the parts that you cannot control. After doing so, when you hear of such news in the future you’ll know that you’ve done all you can and the rest is up to Allah SWT.