Check for window.dbug

For the rare case dbug was not defined or has been removed from clientcide, check if window.dbug exists before using it.