Update modem.js

fix null pointer exception.