Removed NPE when query string is missing