Test if model exist before calling expr_eval for issue315

This commit is contained in:
Cédric Krier
2008-09-03 14:59:38 +02:00
parent 9d437e1a63
commit 46c15d2eff
@@ -52,7 +52,8 @@ class TextBox(WidgetInterface):
spell.detach()
del spell
if not value and self.attrs.get('spell') \
and CONFIG['client.spellcheck']:
and CONFIG['client.spellcheck'] \
and self._view and self._view.model:
language = self._view.model.expr_eval(self.attrs['spell'])
try:
spell = gtkspell.Spell(self.textview)
@@ -94,7 +95,8 @@ class TextBox(WidgetInterface):
spell.detach()
del spell
if self.attrs.get('spell') and CONFIG['client.spellcheck']:
if self.attrs.get('spell') and CONFIG['client.spellcheck'] \
and self._view and self._view.model:
language = self._view.model.expr_eval(self.attrs['spell'])
try:
spell = gtkspell.Spell(self.textview)