Skip to content

Commit

Permalink
Merge pull request #176 from hube/handle_blank_lines
Browse files Browse the repository at this point in the history
skip blank lines instead of throwing an exception
  • Loading branch information
SeanPONeil committed Apr 5, 2014
2 parents 3df94a5 + 225d12e commit 27733e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/com/activeandroid/DatabaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ private void executeSqlScript(SQLiteDatabase db, String file) {
String line = null;

while ((line = reader.readLine()) != null) {
db.execSQL(line.replace(";", ""));
line = line.replace(";", "").trim();
if (!line.isEmpty()) {
db.execSQL(line);
}
}
}
catch (IOException e) {
Expand Down

0 comments on commit 27733e7

Please sign in to comment.