diff options
author | chai <chaifix@163.com> | 2019-01-31 18:38:35 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-01-31 18:38:35 +0800 |
commit | 2ec55fd974a63b705a4777c256d2222c874fa043 (patch) | |
tree | 48f1fea59ee9fc713a28a9aac3f05b98dc5ae66f /Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c | |
parent | c581dfbf1e849f393861d15e82aa6446c0c1c310 (diff) |
*SDL project
Diffstat (limited to 'Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c')
-rw-r--r-- | Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c b/Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c index 105d5fe..e6c0c1c 100644 --- a/Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c +++ b/Source/3rdParty/SDL2/src/power/linux/SDL_syspower.c @@ -608,12 +608,12 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second { SDL_bool retval = SDL_FALSE; - #if SDL_USE_LIBDBUS +#if SDL_USE_LIBDBUS SDL_DBusContext *dbus = SDL_DBus_GetContext(); char **paths = NULL; int i, numpaths = 0; - if (!SDL_DBus_CallMethodOnConnection(dbus->system_conn, UPOWER_DBUS_NODE, UPOWER_DBUS_PATH, UPOWER_DBUS_INTERFACE, "EnumerateDevices", + if (!dbus || !SDL_DBus_CallMethodOnConnection(dbus->system_conn, UPOWER_DBUS_NODE, UPOWER_DBUS_PATH, UPOWER_DBUS_INTERFACE, "EnumerateDevices", DBUS_TYPE_INVALID, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &paths, &numpaths, DBUS_TYPE_INVALID)) { return SDL_FALSE; /* try a different approach than UPower. */ @@ -631,7 +631,7 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second if (dbus) { dbus->free_string_array(paths); } - #endif /* SDL_USE_LIBDBUS */ +#endif /* SDL_USE_LIBDBUS */ return retval; } |