1
0
Caleb Porzio 1 жил өмнө
parent
commit
95232e4fae

+ 1 - 1
packages/alpinejs/src/directives/x-model.js

@@ -32,7 +32,7 @@ directive('model', (el, { modifiers, expression }, { effect, cleanup }) => {
 
         // The following code prevents an infinite loop when using:
         // x-model="$model" by retreiving an x-model higher in the tree...
-        if (result._x_modelAccessor) {
+        if (typeof result === 'object' && result !== null && result._x_modelAccessor) {
             return result._x_modelAccessor.closest
         }