diff --git a/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java b/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java
+++ b/src/main/java/com/j256/ormlite/dao/BaseDaoImpl.java
@@ -622,6 +622,9 @@ public abstract class BaseDaoImpl<T, ID> implements Dao<T, ID> {
 	public ID extractId(T data) throws SQLException {
 		checkForInitialized();
 		FieldType idField = tableInfo.getIdField();
+		if (idField == null) {
+			throw new SQLException("Class " + dataClass + " does not have an id field");
+		}
 		@SuppressWarnings("unchecked")
 		ID id = (ID) idField.extractJavaFieldValue(data);
 		return id;
Added a better throw instead of a NPE.