mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
GPU: handles missing GPU type as null in JSON output
This commit is contained in:
@@ -386,9 +386,12 @@ bool ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_
|
||||
{
|
||||
case FF_GPU_TYPE_INTEGRATED: type = "Integrated"; break;
|
||||
case FF_GPU_TYPE_DISCRETE: type = "Discrete"; break;
|
||||
default: type = "Unknown"; break;
|
||||
default: type = NULL; break;
|
||||
}
|
||||
yyjson_mut_obj_add_str(doc, obj, "type", type);
|
||||
if (type)
|
||||
yyjson_mut_obj_add_str(doc, obj, "type", type);
|
||||
else
|
||||
yyjson_mut_obj_add_null(doc, obj, "type");
|
||||
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "vendor", &gpu->vendor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user