Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql	6 Oct 2001 16:30:30 -0000	1.2
+++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-create.sql	3 Feb 2002 14:40:27 -0000	1.3
@@ -413,7 +413,11 @@
 
     v_impl_id := acs_sc_impl__get_id(p_contract_name,p_impl_name);
 
-    perform acs_sc_binding__new(v_contract_id,v_impl_id);
+    if v_contract_id is null or v_impl_id is null then
+        raise exception ''Binding of % to % failed.'', p_contract_name, p_impl_name;
+    else
+        perform acs_sc_binding__new(v_contract_id,v_impl_id);
+    end if;
 
     return 0;
 
