fleet/server/service/osquery_utils/utils.go
Tomas Touceda 11dff7ca92
Issue 1588 allow disabling host users (#1611)
* Allow users to disable host_users

* Add missing files

* Address review comments

* Fix tests

* Check additional queries for nil, not the whole hostsettings

* Finally fix tests
2021-08-11 14:56:11 -03:00

12 lines
320 B
Go

package osquery_utils
// EmptyToZero Sometimes osquery gives us empty string where we expect an integer.
// We change the to "0" so it can be handled by the appropriate string to
// integer conversion function, as these will err on ""
func EmptyToZero(val string) string {
if val == "" {
return "0"
}
return val
}