mirror of https://github.com/encounter/SDL.git
Handle NULL return from SDL_DBus_GetContext()
This commit is contained in:
parent
b5d231eede
commit
a9ae1b508d
|
@ -613,7 +613,7 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second
|
||||||
char **paths = NULL;
|
char **paths = NULL;
|
||||||
int i, numpaths = 0;
|
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_INVALID,
|
||||||
DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &paths, &numpaths, DBUS_TYPE_INVALID)) {
|
DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &paths, &numpaths, DBUS_TYPE_INVALID)) {
|
||||||
return SDL_FALSE; /* try a different approach than UPower. */
|
return SDL_FALSE; /* try a different approach than UPower. */
|
||||||
|
|
Loading…
Reference in New Issue