Added null check for preSharedKey

In WifiNetworkSelector.removeSecurityParamsIfNecessary method, preSharedKey
field in WifiConfiguration is accessed to check if the configured
preshared key is a 64 hex digits. There is no null check for preSharedKey
before accessing the contents. So a badly formed WifiConfiguration with preSharedKey
set to null causes the NullPointerException.
To fix the exception issue, added a null check for preSharedKey.

Bug: 340136269
Test: Manual - STA connect/disconnect with AP configured in WPA2.
Change-Id: I813dffacc9ade0cf9e87264406331bf038cdce0b
1 file changed