Skip to content

Commit c7baab7

Browse files
nivesninemichaelmior
authored andcommitted
fix for Updating a json object fails if the value of a key is boolean kennknowles#73
1 parent da65b02 commit c7baab7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jsonpath_ng/jsonpath.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,9 @@ def update_or_create(self, data, val):
597597
def _update_base(self, data, val, create):
598598
if data is not None:
599599
for field in self.reified_fields(DatumInContext.wrap(data)):
600-
if field not in data and create:
600+
if create and field not in data:
601601
data[field] = {}
602-
if field in data:
602+
if type(data) is not bool and field in data:
603603
if hasattr(val, '__call__'):
604604
data[field] = val(data[field], data, field)
605605
else:

0 commit comments

Comments
 (0)