JS driver: fixed bug on connect() handling null response