diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp
index 237b0b2b4bb00dc2d89ddbc45c3a5c8531736bbe..4753845af7e10367784e18e681429f7c2daff083 100644
--- a/src/fix_langevin.cpp
+++ b/src/fix_langevin.cpp
@@ -108,6 +108,9 @@ int FixLangevin::setmask()
 
 void FixLangevin::init()
 {
+  if (atom->mass == NULL)
+    error->all("Cannot use fix langevin without per-type mass defined");
+
   // set force prefactors
 
   for (int i = 1; i <= atom->ntypes; i++) {