summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2010-05-15 22:46:50 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2010-05-15 22:46:50 +0000
commite44e9a3c58e503962e9c9b0e7078b7b143c39aed (patch)
treee4393a162d7c1745c80b26730056ad4093654642 /src
parentA couple small bug fixes for new text toolbar widgets. (diff)
downloadinkscape-e44e9a3c58e503962e9c9b0e7078b7b143c39aed.tar.gz
inkscape-e44e9a3c58e503962e9c9b0e7078b7b143c39aed.zip
lpe-knot: fix crash
Fixed bugs: - https://launchpad.net/bugs/432523 (bzr r9421)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-knot.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp
index b3aa2df45..b8e9b8cf9 100644
--- a/src/live_effects/lpe-knot.cpp
+++ b/src/live_effects/lpe-knot.cpp
@@ -56,17 +56,19 @@ public:
static
std::vector<Geom::Interval> complementOf(Geom::Interval I, std::vector<Geom::Interval> domain){
std::vector<Geom::Interval> ret;
- double min = domain.front().min();
- double max = domain.back().max();
- Geom::Interval I1 = Geom::Interval(min,I.min());
- Geom::Interval I2 = Geom::Interval(I.max(),max);
-
- for (unsigned i = 0; i<domain.size(); i++){
- boost::optional<Geom::Interval> I1i = intersect(domain.at(i),I1);
- if (I1i && !I1i->isSingular()) ret.push_back(I1i.get());
- boost::optional<Geom::Interval> I2i = intersect(domain.at(i),I2);
- if (I2i && !I2i->isSingular()) ret.push_back(I2i.get());
- }
+ if (!domain.empty()) {
+ double min = domain.front().min();
+ double max = domain.back().max();
+ Geom::Interval I1 = Geom::Interval(min,I.min());
+ Geom::Interval I2 = Geom::Interval(I.max(),max);
+
+ for (unsigned i = 0; i<domain.size(); i++){
+ boost::optional<Geom::Interval> I1i = intersect(domain.at(i),I1);
+ if (I1i && !I1i->isSingular()) ret.push_back(I1i.get());
+ boost::optional<Geom::Interval> I2i = intersect(domain.at(i),I2);
+ if (I2i && !I2i->isSingular()) ret.push_back(I2i.get());
+ }
+ }
return ret;
}