X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b9345dfd4b5479ec624f1870723a8ea5c9c719e7..61addbc212a08ba146fc7baa7b3c04071f4445fb:/lisp/net/eudcb-bbdb.el diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el index 5afd255f41..58d9462248 100644 --- a/lisp/net/eudcb-bbdb.el +++ b/lisp/net/eudcb-bbdb.el @@ -1,6 +1,6 @@ ;;; eudcb-bbdb.el --- Emacs Unified Directory Client - BBDB Backend -;; Copyright (C) 1998-2011 Free Software Foundation, Inc. +;; Copyright (C) 1998-2013 Free Software Foundation, Inc. ;; Author: Oscar Figueiredo ;; Maintainer: Pavel Janík @@ -166,18 +166,18 @@ The record is filtered according to `eudc-bbdb-current-return-attributes'" (symbol-name attr))) 'record)))) (t - (setq val "Unknown BBDB attribute"))) - (if val - (cond - ((memq attr '(phones addresses)) - (setq eudc-rec (append val eudc-rec))) - ((and (listp val) - (= 1 (length val))) - (setq eudc-rec (cons (cons attr (car val)) eudc-rec))) - ((> (length val) 0) - (setq eudc-rec (cons (cons attr val) eudc-rec))) - (t - (error "Unexpected attribute value"))))) + (error "Unknown BBDB attribute"))) + (cond + ((or (not val) (equal val ""))) ; do nothing + ((memq attr '(phones addresses)) + (setq eudc-rec (append val eudc-rec))) + ((and (listp val) + (= 1 (length val))) + (setq eudc-rec (cons (cons attr (car val)) eudc-rec))) + ((> (length val) 0) + (setq eudc-rec (cons (cons attr val) eudc-rec))) + (t + (error "Unexpected attribute value")))) (nreverse eudc-rec)))