Caleb Porzio преди 1 година
родител
ревизия
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
         }