I have changed the code as specified and it works fine. Thank you.
For a quick fix, find the file plugins/perfect-woocommerce-brands/classes/admin/class-pwb-coupon.php
and replace
if ( empty( $selected_brands ) ) return;
with:
if ( empty( $selected_brands ) ) return $valid;