Improve message for errors in compiling anonymous PL/Python blocks

The previous code would try to print out a null pointer.

Jan Urbański
pull/1/head
Peter Eisentraut 15 years ago
parent d9a95c0adb
commit 719461b7a2
  1. 6
      src/pl/plpython/plpython.c

@ -1625,7 +1625,11 @@ PLy_procedure_compile(PLyProcedure *proc, const char *src)
return; return;
} }
PLy_elog(ERROR, "could not compile PL/Python function \"%s\"", proc->proname); if (proc->proname)
PLy_elog(ERROR, "could not compile PL/Python function \"%s\"",
proc->proname);
else
PLy_elog(ERROR, "could not compile anonymous PL/Python code block");
} }
static char * static char *

Loading…
Cancel
Save