From fc268f03eb346f539f2f9a7db3e6571b8d9f629c Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 27 Jul 2015 01:00:10 +0200 Subject: [PATCH] * Assert against null pointer exceptions in vocab --- spacy/vocab.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 75a7844e1..86ae7d338 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -101,6 +101,7 @@ cdef class Vocab: lex.id = 0 else: self._add_lex_to_vocab(key, lex) + assert lex != NULL, string return lex cdef const LexemeC* get_by_orth(self, Pool mem, attr_t orth) except NULL: @@ -124,6 +125,7 @@ cdef class Vocab: lex.id = 0 else: self._add_lex_to_vocab(hash_string(string), lex) + assert lex != NULL, orth return lex cdef int _add_lex_to_vocab(self, hash_t key, const LexemeC* lex) except -1: