Fix reintroduction of b/10845061

Prevent crash in case where NLP is not available. Also fix an integer
overflow bug that remained uncaught.

BUG: 22345134
Change-Id: If6ff7b12f0d15bb2fe97589f8b0be10f9ed06197
(cherry picked from commit 2ec5c5cced4bd5b9dfbb7578f573c56b3bbc7ddf)
1 file changed