(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.

Patchset ?: Fixed a test

Change-Id: I4083e13db627bacbdd96c8bd8626cffbf2e24f1c
Merge "(bug 46597) avoid namespace checker error, check variable type"