(bug 46597) avoid namespace checker error, check variable type

- if ns is not an int, then return false and not exception,
but put debug log there instead.

Change-Id: I4083e13db627bacbdd96c8bd8626cffbf2e24f1c