Caleb Porzio 1 год назад
Родитель
Сommit
95232e4fae
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      packages/alpinejs/src/directives/x-model.js

+ 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
         }