     
     func hideVideoView(command: CDVInvokedUrlCommand) {
         dispatch_async(dispatch_get_main_queue()) {
-            self.localVideoView!.hidden = true;
-            
+            if (self.localVideoView != nil) {
+                self.localVideoView!.hidden = true;
+            }    
             for remoteVideoView in self.remoteVideoViews {
                 remoteVideoView.videoView.hidden = true;
             }

struct VideoTrackViewPair {
    var videoView: RTCEAGLVideoView
    var videoTrack: RTCVideoTrack
}
    
    func showVideoView(command: CDVInvokedUrlCommand) {
        dispatch_async(dispatch_get_main_queue()) {
            if (self.localVideoView != nil) {
                self.localVideoView!.hidden = false;
            }    
            for remoteVideoView in self.remoteVideoViews {
                remoteVideoView.videoView.hidden = false;
            } 
