Solution:
Simple check if function ‘bp_is_active’ is defined:
if ( function_exists('bp_is_active') ) { // do something here... }
see shanebp answer and comments.