Check if sidebar is active on page with id

You mean like this:

if (is_active_sidebar($sidebar-name) && is_page($page-id)) {do your thing}

?

error code: 523