Skip to content

Commit

Permalink
fix(conan): Properly inspect null values
Browse files Browse the repository at this point in the history
This is a fixup for 802dfa8.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Aug 8, 2024
1 parent 5bf0935 commit 63ab950
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
project:
id: "Conan::poco:null"
id: "Conan::poco:"
definition_file_path: "plugins/package-managers/conan/src/funTest/assets/projects/synthetic/conan-py/conanfile.py"
declared_licenses:
- "BSL-1.0"
Expand Down
5 changes: 4 additions & 1 deletion plugins/package-managers/conan/src/main/kotlin/Conan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import java.io.File

import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive

Expand Down Expand Up @@ -334,7 +335,9 @@ class Conan(
}
}

return results[field]?.jsonPrimitive?.content
// Note that while the console output of "conan inspect" uses "None" for absent values, the JSON output actually
// uses null values.
return results[field]?.jsonPrimitive?.contentOrNull
}

/**
Expand Down

0 comments on commit 63ab950

Please sign in to comment.