bug #4520 sql.js: cannot read property

Signed-off-by: Marc Delisle <marc@infomarc.info>