bugfix; <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'contents'

Change-Id: Icf8c8d9e2e2b42566fc3a9df4bbb527afd937a6c