Check if console.warn is defined before calling it