Permalink
Browse files

ConnectPlugin android should return error if trying to login or other…

… stuff before calling init
  • Loading branch information...
1 parent 1246bdf commit 76ea6980c4b52c04ff9e473c7145b5052bf4eaf1 @filmaj filmaj committed Jan 12, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 native/android/src/com/phonegap/facebook/ConnectPlugin.java
View
4 native/android/src/com/phonegap/facebook/ConnectPlugin.java
@@ -135,12 +135,16 @@ else if (action.equals("logout")) {
pr = new PluginResult(PluginResult.Status.IO_EXCEPTION, "Error logging out.");
}
pr = new PluginResult(PluginResult.Status.OK, getResponse());
+ } else {
+ pr = new PluginResult(PluginResult.Status.ERROR, "Must call init before logout.");
}
}
else if (action.equals("getLoginStatus")) {
if (facebook != null) {
pr = new PluginResult(PluginResult.Status.OK, getResponse());
+ } else {
+ pr = new PluginResult(PluginResult.Status.ERROR, "Must call init before getLoginStatus.");
}
}

0 comments on commit 76ea698

Please sign in to comment.