Skip to content

Commit d782b3f

Browse files
committed
Return if name & address are null
1 parent 2227bca commit d782b3f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/registrar_client/lib/src/farms.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ class Farms {
2727
return List<Farm>.from(response.map((farm) => Farm.fromJson(farm)));
2828
}
2929

30-
Future<dynamic> update(
31-
int twinID, int farmID, {String? farmName, String? stellarAddress}) async {
30+
Future<dynamic> update(int twinID, int farmID,
31+
{String? farmName, String? stellarAddress}) async {
32+
if (farmName == null && stellarAddress == null) {
33+
return;
34+
}
3235
final header = createAuthHeader(twinID, _client.privateKey);
3336
final body = {
3437
if (farmName != null) 'farm_name': farmName,

0 commit comments

Comments
 (0)