Use try/except to catch nonetype case. For whatever reason, databuffer could still be None, this should take care of that.