Although it is commonly shown…

Although it is commonly shown in medical dramas, you do not shock someone with a flatline. You only use defibrillators on people with ventricular fibrillation, and pulseless ventricular tachycardia (heart beats out of rhythm or heart beats that are really fast and out of sync).