Fix null pointer dereference
This commit is contained in:
parent
cc3ca163c4
commit
019301b7b2
2
main.c
2
main.c
|
@ -321,7 +321,7 @@ int main(void)
|
||||||
/* Try to auto-detect controller if none*/
|
/* Try to auto-detect controller if none*/
|
||||||
if (!pad) {
|
if (!pad) {
|
||||||
pad = detectPad();
|
pad = detectPad();
|
||||||
if (pad->hotplug) {
|
if (pad && (pad->hotplug)) {
|
||||||
// For gamecube, this make sure the next
|
// For gamecube, this make sure the next
|
||||||
// analog values we read become the center
|
// analog values we read become the center
|
||||||
// reference.
|
// reference.
|
||||||
|
|
Loading…
Reference in New Issue