NPE fix if profiling is disabled
export queries to api-format