[Qgis-developer] python: QgsProject.instance() sometimes failing

Richard Duivenvoorde rdmailings at duif.net
Tue Apr 22 13:28:28 PDT 2014


Hi, trying to test/upgrade the the Live Stats plugin, we encounter the
following error sometimes (it is hard to find out when exaclty):

Traceback (most recent call last):
  File "/home/richard/.qgis2/python/plugins/liveStats/LSmain.py", line
154, in saveToFile

QgsProject.instance().writeEntry('LiveStats','SavedStats',saveStringsLists)
AttributeError: 'NoneType' object has no attribute 'instance'

So it seems that QgsProject evaluates to NoneType ???

Not sure when it exactly it happens, but obviously this should never be
the case is it?

Anybody an idea?

Regards,

Richard Duivenvoorde


More information about the Qgis-developer mailing list