diff --git a/Layers.js b/Layers.js
index <HASH>..<HASH> 100644
--- a/Layers.js
+++ b/Layers.js
@@ -444,6 +444,10 @@ Object.extend(cop, {
 
     // layer around only the class methods
     layerClass: function(layer, classObject, defs) {
+        if (!classObject || !classObject.prototype) {
+            throw new Error("ContextJS: can not refine class '" +
+                            classObject +  "' in " + layer);
+        }
         cop.layerObject(layer, classObject.prototype, defs);
     },
Merging remaining webwerkstatt changes for <I> release to core, part 2