[lldb] Host::ShellExpandArguments - fix error check for valid dictionary

Fix repeated check for a valid JSON parse and actually check the dictionary pointer

Reported here: https://pvs-studio.com/en/blog/posts/cpp/1003/ (N40)
This commit is contained in:
Simon Pilgrim 2022-10-25 17:43:47 +01:00
parent 6fcaaf89fe
commit 93a5a03030
1 changed files with 1 additions and 1 deletions

View File

@ -245,7 +245,7 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
}
auto dict_sp = data_sp->GetAsDictionary();
if (!data_sp) {
if (!dict_sp) {
error.SetErrorString("invalid JSON");
return error;
}