Skip to content

Commit

Permalink
still null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
dep11007 committed Apr 28, 2015
1 parent c439607 commit ae4b431
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/InputOutput/UserLogin.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ public void handle(ActionEvent e) {
String queriedPassword = null;
try {
queriedEmail = _server.getUserFromEmail(enteredEmail).get("email");
queriedPassword = _server.getUserFromEmail(queriedPassword).get("password");
queriedPassword = _server.getUserFromEmail(enteredPassword).get("password");
} catch(Exception e1){
System.out.println("user and password does not exist");

e1.printStackTrace();
System.out.println("ERROR: user and password does not exist");
}

if(queriedEmail ==null || queriedPassword==null){
if(queriedEmail == null || queriedPassword == null){
System.out.println("user and password does not exist");
} else {
if (queriedEmail.equals(enteredEmail) && queriedPassword.equals(enteredPassword)){
if (enteredEmail.equals(queriedEmail) && enteredPassword.equals(queriedPassword)){
_loggedin = true;
try{//opens new window when login true
Parent root = FXMLLoader.load(getClass().getResource("/interface_xml_files/SetupThermo.fxml"));
Expand Down
2 changes: 1 addition & 1 deletion src/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
Parent root = FXMLLoader.load(getClass().getResource("/interface_xml_files/login.fxml"));
Parent root = FXMLLoader.load(getClass().getResource("/interface_xml_files/ServerThermo.fxml"));
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
Expand Down
1 change: 1 addition & 0 deletions src/server/server.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public server() throws Exception {
Database dataStorage = new Database(this);
dataStorage.createUser(email, adminPassword, ip, serialNumber);
this.startServerListenerThreadCurrentTemp();
instance = this;
}

public boolean createUser(String email, String password, String ip, String serialpermission) {
Expand Down
1 change: 0 additions & 1 deletion src/user_interface/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,5 @@ public static void closeAllWindows(){
stage.hide();
}
}
// MainApp.openWindow(MainApp.class.getResource("WohlerWindow.fxml"), "Wohler Device Manager", false); using it

}

0 comments on commit ae4b431

Please sign in to comment.