Skip to content

Commit 2b2c131

Browse files
authored
Update LiveMeter.py
1 parent 8338430 commit 2b2c131

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sourceplusplus/models/instrument/LiveMeter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def from_json(cls, json_str):
2424
for key in json_dict:
2525
setattr(meter, key, json_dict[key])
2626
meter.location = LiveSourceLocation(json_dict["location"]["source"], json_dict["location"]["line"])
27-
meter.throttle = HitThrottle(json_dict["throttle"]["limit"], ThrottleStep(json_dict["throttle"]["step"]))
27+
28+
if "throttle" in json_dict:
29+
meter.throttle = HitThrottle(json_dict["throttle"]["limit"], ThrottleStep(json_dict["throttle"]["step"]))
30+
2831
meter.type = LiveInstrumentType.METER
2932
return meter

0 commit comments

Comments
 (0)