Skip to content

Commit

Permalink
fix(mount): check if state prop is null/undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkolind committed Dec 6, 2023
1 parent 2112554 commit e0d5541
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/one.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function watch(obj, key, fn) {
function mount({ el, state, view }) {
const proxy = state ? new Proxy({ ...state }, {
set(obj, prop, value) {
if (!obj[prop]) {
if (obj[prop] == null) {
throw new Error(`The property "${prop}" does not exist on the state object.`)
}
if (obj[prop] === value) return true
Expand Down

0 comments on commit e0d5541

Please sign in to comment.