summaryrefslogtreecommitdiff
path: root/src/runtime/c/pgf
diff options
context:
space:
mode:
authorKrasimir Angelov <kr.angelov@gmail.com>2017-08-07 14:47:20 +0200
committerKrasimir Angelov <kr.angelov@gmail.com>2017-08-07 14:47:20 +0200
commita4c19875ed4a97671d17d6d6f062b465ae1f87a6 (patch)
tree6a8f202a12bd97c799ebf94bdd43a76c8a0f6ca5 /src/runtime/c/pgf
parented33e53b2e21712e255e5dbaafe4db34d61be46f (diff)
fix the sentence lookup for cases when the top category is undefined.
Diffstat (limited to 'src/runtime/c/pgf')
-rw-r--r--src/runtime/c/pgf/lookup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/c/pgf/lookup.c b/src/runtime/c/pgf/lookup.c
index 90e7b24fc..27e126d66 100644
--- a/src/runtime/c/pgf/lookup.c
+++ b/src/runtime/c/pgf/lookup.c
@@ -983,7 +983,7 @@ pgf_lookup_sentence(PgfConcr* concr, PgfType* typ, GuString sentence, GuPool* po
PgfCncCat* cnccat =
gu_map_get(concr->cnccats, typ->cid, PgfCncCat*);
- size_t n_ccats = gu_seq_length(cnccat->cats);
+ size_t n_ccats = (cnccat) ? gu_seq_length(cnccat->cats) : 0;
for (size_t i = 0; i < n_ccats; i++) {
PgfCCat* ccat = gu_seq_get(cnccat->cats, PgfCCat*, i);
PgfCCat* new_ccat = pgf_lookup_concretize(&st, cache, st.start_id, ccat);