aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrap.c')
-rw-r--r--src/wrap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wrap.c b/src/wrap.c
index 018f9e3..6389905 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -960,7 +960,9 @@ int wrap_contents(struct frame *fr)
//distribute_spaces(line, wrap_w, rho);
/* Strip any sentinel boxes added by the wrapping algorithm */
- if ( bv_last(line->boxes)->type == WRAP_BOX_SENTINEL ) {
+ if ( (bv_last(line->boxes) != NULL)
+ && (bv_last(line->boxes)->type == WRAP_BOX_SENTINEL) )
+ {
line->boxes->n_boxes--;
}