diff --git a/src/context2d.cc b/src/context2d.cc index f2bbb80..f92f072 100644 --- a/src/context2d.cc +++ b/src/context2d.cc @@ -242,8 +242,11 @@ Context2d::GetMiterLimit(Local prop, const AccessorInfo &info) { void Context2d::SetMiterLimit(Local prop, Local val, const AccessorInfo &info) { - Context2d *context = ObjectWrap::Unwrap(info.This()); - cairo_set_miter_limit(context->getContext(), val->NumberValue()); + double n = val->NumberValue(); + if (n > 0) { + Context2d *context = ObjectWrap::Unwrap(info.This()); + cairo_set_miter_limit(context->getContext(), n); + } } /*