          (pos (point))
          (column-num (+ 1 (ycmd--column-in-bytes)))
          (line-num (line-number-at-pos pos))
-         (full-path (ycmd--get-full-path-to-current-buffer))
+         (full-path (ycmd--encode-string (or (buffer-file-name) "")))
          (file-contents (ycmd--encode-string
                          (buffer-substring-no-properties
                           (point-min) (point-max))))

(defun ycmd--on-close-buffer ()
  "Notify server that the current buffer is no longer open, and cleanup emacs-ycmd variables."
  (when (ycmd-is-server-alive?)
    (ycmd--notify-server "BufferUnload"
                         `(("unloaded_buffer" . ,(ycmd--get-full-path-to-current-buffer)))))
  (ycmd--teardown))

(defun ycmd--teardown ()

          (message "Error sending %s request: %s" event-name err)
          (ycmd--report-status 'errored))))))

(defun ycmd--notify-server (event-name)
  "Send a simple event notification for EVENT-NAME, ignoring response."
  (let* ((data (ycmd--get-request-data))
         (content (plist-get data :content)))
    (ycmd--event-notification event-name content)))

(defun ycmd-notify-file-ready-to-parse ()
