From: Magnus H. <leg...@us...> - 2007-11-21 12:48:08
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv28232 Modified Files: jabber-xml.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-425 Creator: Magnus Henoch <ma...@fr...> Don't signal error in jabber-xml-get-attribute if NODE is a string Index: jabber-xml.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-xml.el,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- jabber-xml.el 20 Mar 2007 11:49:25 -0000 1.20 +++ jabber-xml.el 21 Nov 2007 12:48:01 -0000 1.21 @@ -1,7 +1,7 @@ ;; jabber-xml.el - XML functions +;; Copyright (C) 2003, 2004, 2007 - Magnus Henoch - ma...@fr... ;; Copyright (C) 2002, 2003, 2004 - tom berger - ob...@in... -;; Copyright (C) 2003, 2004 - Magnus Henoch - ma...@fr... ;; This file is a part of jabber.el. @@ -158,12 +158,14 @@ (defsubst jabber-xml-get-attribute (node attribute) "Get from NODE the value of ATTRIBUTE. Return nil if the attribute was not found." - (xml-get-attribute-or-nil node attribute)) + (when (consp node) + (xml-get-attribute-or-nil node attribute))) (defsubst jabber-xml-get-attribute (node attribute) "Get from NODE the value of ATTRIBUTE. Return nil if the attribute was not found." - (let ((result (xml-get-attribute node attribute))) - (and (> (length result) 0) result))))) + (when (consp node) + (let ((result (xml-get-attribute node attribute))) + (and (> (length result) 0) result)))))) (defsubst jabber-xml-get-xmlns (node) "Get \"xmlns\" attribute of NODE, or nil if not present." |