diff --git a/src/lemon/error.h b/src/lemon/error.h
index 01931d8..ffcd46c 100644
--- a/src/lemon/error.h
+++ b/src/lemon/error.h
@@ -67,9 +67,9 @@ namespace lemon {
     }
 
     ExceptionMember& operator=(const ExceptionMember& copy) {
-      if (ptr.get() == 0) return;
+      if (ptr.get() == 0) return *this;
       try {
-	if (!copy.valid()) return;
+	if (!copy.valid()) return *this;
  	*ptr = copy.get();
       } catch (...) {}
     }
