Peripheral_HRS example: Only notify when connected?

I've adapted the peripheral_hr example for my purposes and its working but one thing I see is that the example never checks if the connection is established before calling notify. 

I guess this will just fill up the buffer and shouldn't massively impact battery life but is there a simple way to check if the connection is active before calling notify?