Check if Sidebar Contains Widgets

Use the following snippet, if you want to check, if a sidebar contains widgets:

if ( is_active_sidebar( 'left-sidebar' ) ) {
    // sidebar contains widgets
} else {
    // sidebar does not contain widgets
};

Instead of left-sidebar, use the ID of your sidebar.