Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 719461b

Browse files
committed
Improve message for errors in compiling anonymous PL/Python blocks
The previous code would try to print out a null pointer. Jan Urbański
1 parent d9a95c0 commit 719461b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pl/plpython/plpython.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,11 @@ PLy_procedure_compile(PLyProcedure *proc, const char *src)
16251625
return;
16261626
}
16271627

1628-
PLy_elog(ERROR, "could not compile PL/Python function \"%s\"", proc->proname);
1628+
if (proc->proname)
1629+
PLy_elog(ERROR, "could not compile PL/Python function \"%s\"",
1630+
proc->proname);
1631+
else
1632+
PLy_elog(ERROR, "could not compile anonymous PL/Python code block");
16291633
}
16301634

16311635
static char *

0 commit comments

Comments
 (0)