Update export function to return early if data is null.