Skip to content

Commit 9e0a26b

Browse files
committed
Handle when applications/gecko.id is all-whitespace
1 parent 87b257d commit 9e0a26b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dotnet/src/webdriver/Firefox/FirefoxExtension.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,16 @@ private static string ReadIdFromInstallRdf(string root)
178178

179179
private static string ReadIdFromManifestJson(string root)
180180
{
181-
string id;
181+
string id = string.Empty;
182182
string manifestJsonPath = Path.Combine(root, JsonManifestFileName);
183183

184184
var manifestObject = JsonNode.Parse(File.ReadAllText(manifestJsonPath));
185185
if (manifestObject!["applications"]?["gecko"]?["id"] is { } idNode)
186186
{
187187
id = idNode.ToString().Trim();
188188
}
189-
else
189+
190+
if (string.IsNullOrEmpty(id))
190191
{
191192
string addInName = manifestObject["name"]!.ToString().Replace(" ", "");
192193
string addInVersion = manifestObject["version"]!.ToString();

0 commit comments

Comments
 (0)