Guard against null request in Android 1.5/1.6

This commit is contained in:
macdonst 2011-01-06 00:29:17 +08:00
parent a7415bcfc9
commit 54eff557d9

View File

@ -188,6 +188,7 @@ public class CallbackServer implements Runnable {
request = xhrReader.readLine(); request = xhrReader.readLine();
String response = ""; String response = "";
//System.out.println("CallbackServerRequest="+request); //System.out.println("CallbackServerRequest="+request);
if (request != null) {
if (request.contains("GET")) { if (request.contains("GET")) {
// Must have security token // Must have security token
@ -235,7 +236,9 @@ public class CallbackServer implements Runnable {
//System.out.println("CallbackServer: closing output"); //System.out.println("CallbackServer: closing output");
output.writeBytes(response); output.writeBytes(response);
output.flush(); output.flush();
}
output.close(); output.close();
xhrReader.close();
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();