(bug 49417) Handle failure to deserialize entity in lua

Change-Id: I85e387b62ff0f940de31acec166c28ff389114ad
Merge "(bug 49417) Handle failure to deserialize entity in lua"