Adding assert and removing conditional that would silently skip the unnexpected error.