diff --git a/pdf.c b/pdf.c
index e814a39ae96540daa196aea4db7a67335b6d5c09..daca61d7b54644090392502f15125b9bf4a0a3b9 100644
--- a/pdf.c
+++ b/pdf.c
@@ -2015,14 +2015,11 @@ act_txtobj(const HParseResult *p, void *u)
 
 	tstr = h_arena_malloc(p->arena, sizeof(uint8_t) * textlen);
 	int idx=0;
-	TextState_T      *ts;
 	// Now concatenate the pieces
 	for (int i =0; i < opstream->seq->used; i++) {
 		txte = H_CAST(TextEntry, opstream->seq->elements[i]);
 		assert(txte != NULL);
 		assert(txte->node == node);
-		ts   = &txte->node->ts;
-		assert(ts->node == node);
 
 		// Process the text operators
 		switch (txte->type) {
@@ -2114,7 +2111,7 @@ act_txtobj(const HParseResult *p, void *u)
 	txtobj->tstr.nchars  = textlen;
 	txtobj->tstr.tobj    = opstream;
 	if (textlen)
-		txtobj->node = ts->node;
+		txtobj->node = node;
 	else
 		txtobj->node = NULL;
 	// pretty print the information