Browse Source

Fixed nullpointer exception when highsore doesn't exist

jancoow 10 years ago
parent
commit
f3f1a11a75
1 changed files with 3 additions and 1 deletions
  1. 3 1
      data/io/SQLConnector.java

+ 3 - 1
data/io/SQLConnector.java

@@ -62,7 +62,9 @@ public class SQLConnector
 		
     	try {
     		result.next();
-    		hsc = new Highscore(si, result.getString("username"), result.getInt("score"), result.getDate("date").getTime());
+    		if(result != null)
+    			hsc = new Highscore(si, result.getString("username"), result.getInt("score"), result.getDate("date").getTime());
+    		
 		} catch (SQLException e) {
 			e.printStackTrace();
 		}