aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_rtext.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/src/g_rtext.c')
-rw-r--r--pd/src/g_rtext.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c
index 948ebcb4..63a7485b 100644
--- a/pd/src/g_rtext.c
+++ b/pd/src/g_rtext.c
@@ -342,8 +342,11 @@ void rtext_retext(t_rtext *x)
/* find the rtext that goes with a text item */
t_rtext *glist_findrtext(t_glist *gl, t_text *who)
{
- t_rtext *x = gl->gl_editor->e_rtext;
- while (x && x->x_text != who) x = x->x_next;
+ t_rtext *x;
+ if (!gl->gl_editor)
+ canvas_create_editor(gl);
+ for (x = gl->gl_editor->e_rtext; x && x->x_text != who; x = x->x_next)
+ ;
if (!x) bug("glist_findrtext");
return (x);
}