Improve message for errors in compiling anonymous PL/Python blocks

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

Jan Urbański
This commit is contained in:
Peter Eisentraut 2011-01-19 00:03:57 +02:00
parent d9a95c0adb
commit 719461b7a2
1 changed files with 5 additions and 1 deletions

View File

@ -1625,7 +1625,11 @@ PLy_procedure_compile(PLyProcedure *proc, const char *src)
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 *