     }
     
     @IBAction func flashButtonPressed(sender: UIButton) {
+
+        if !cameraIsAvailable() {
+
+            return
+        }
 
         do {
 

            return
        }
    }
}

    }
    
    @IBAction func flipButtonPressed(sender: UIButton) {

        if !cameraIsAvailable() {

            return
        }
        
        session?.stopRunning()
        
