Small fixed to nipap.py and nipap.js

Added error check to a function used to receive XHR data in nipap.js.
Added string conversion of variables used in error log message, to
handle them being None.