Bugfix - if getCurrentQuery returns NULL you got a php error