From 66df471243a25024e827012eaa9fd4c08e941536 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 8 Dec 2022 14:14:09 +0100 Subject: [PATCH] neon: Fix user agent in debug builds --- packages/neon/lib/src/models/account.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/neon/lib/src/models/account.dart b/packages/neon/lib/src/models/account.dart index d58cacd9..a28d84f1 100644 --- a/packages/neon/lib/src/models/account.dart +++ b/packages/neon/lib/src/models/account.dart @@ -7,7 +7,13 @@ import 'package:package_info_plus/package_info_plus.dart'; part 'account.g.dart'; -String userAgent(final PackageInfo packageInfo) => 'Neon ${packageInfo.version}+${packageInfo.buildNumber}'; +String userAgent(final PackageInfo packageInfo) { + var buildNumber = packageInfo.buildNumber; + if (buildNumber == '') { + buildNumber = '1'; + } + return 'Neon ${packageInfo.version}+$buildNumber'; +} @JsonSerializable() class Account {