Bluetooth: has: Fix sending invalid opcode error

If preset synchronization is not supported, Preset Sync
Not Supported (0x82) shall be sent in error response.

Fixes: HAS/SR/SPE/BI-04-C, HAS/SR/SPE/BI-05-C, HAS/SR/SPE/BI-06-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
diff --git a/subsys/bluetooth/audio/has.c b/subsys/bluetooth/audio/has.c
index efae8ce..eb3cb1e 100644
--- a/subsys/bluetooth/audio/has.c
+++ b/subsys/bluetooth/audio/has.c
@@ -701,14 +701,24 @@
 		return handle_set_next_preset(false);
 	case BT_HAS_OP_SET_PREV_PRESET:
 		return handle_set_prev_preset(false);
-#if defined(CONFIG_BT_HAS_PRESET_SYNC_SUPPORT)
 	case BT_HAS_OP_SET_ACTIVE_PRESET_SYNC:
-		return handle_set_active_preset(buf, true);
+		if (IS_ENABLED(CONFIG_BT_HAS_PRESET_SYNC_SUPPORT)) {
+			return handle_set_active_preset(buf, true);
+		} else {
+			return BT_HAS_ERR_PRESET_SYNC_NOT_SUPP;
+		}
 	case BT_HAS_OP_SET_NEXT_PRESET_SYNC:
-		return handle_set_next_preset(true);
+		if (IS_ENABLED(CONFIG_BT_HAS_PRESET_SYNC_SUPPORT)) {
+			return handle_set_next_preset(true);
+		} else {
+			return BT_HAS_ERR_PRESET_SYNC_NOT_SUPP;
+		}
 	case BT_HAS_OP_SET_PREV_PRESET_SYNC:
-		return handle_set_prev_preset(true);
-#endif /* CONFIG_BT_HAS_PRESET_SYNC_SUPPORT */
+		if (IS_ENABLED(CONFIG_BT_HAS_PRESET_SYNC_SUPPORT)) {
+			return handle_set_prev_preset(true);
+		} else {
+			return BT_HAS_ERR_PRESET_SYNC_NOT_SUPP;
+		}
 	};
 
 	return BT_HAS_ERR_INVALID_OPCODE;