[Psi-devel] Re: tons of lines with QGDict::hashKeyString: Invalid null key

Remko Troncon remko.troncon at cs.kuleuven.ac.be
Fri Feb 25 07:11:48 PST 2005


This seems to do the trick.

cheers,
Remko


Index: xmpp-core/jid.cpp
===================================================================
RCS file: /psi/iris/xmpp-core/jid.cpp,v
retrieving revision 1.4
diff -u -r1.4 jid.cpp
--- xmpp-core/jid.cpp	21 Feb 2005 20:46:21 -0000	1.4
+++ xmpp-core/jid.cpp	25 Feb 2005 15:10:07 -0000
@@ -33,6 +33,11 @@
 public:
 	static bool nameprep(const QString &in, int maxbytes, QString *out)
 	{
+		if (in.isEmpty()) {
+			*out = QString();
+			return true;
+		}
+
 		StringPrepCache *that = get_instance();
 
 		Result *r = that->nameprep_table.find(in);
@@ -62,6 +67,11 @@
 
 	static bool nodeprep(const QString &in, int maxbytes, QString *out)
 	{
+		if (in.isEmpty()) {
+			*out = QString();
+			return true;
+		}
+		
 		StringPrepCache *that = get_instance();
 
 		Result *r = that->nodeprep_table.find(in);
@@ -91,6 +101,11 @@
 
 	static bool resourceprep(const QString &in, int maxbytes, QString *out)
 	{
+		if (in.isEmpty()) {
+			*out = QString();
+			return true;
+		}
+
 		StringPrepCache *that = get_instance();
 
 		Result *r = that->resourceprep_table.find(in);


More information about the Psi-devel-affinix.com mailing list