diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2006-04-02 04:41:33 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2006-04-02 04:41:33 +0000 |
| commit | 294cf75a6c4b70069b1fc5379b19a2da01bb54e6 (patch) | |
| tree | 636c246af4e74fb9888ff8d5fa723d7049c9dee2 /src/ui/widget/selected-style.cpp | |
| parent | from Dale Harvey and Aaron Spike: fixes to overly-general "mouse down" (diff) | |
| download | inkscape-294cf75a6c4b70069b1fc5379b19a2da01bb54e6.tar.gz inkscape-294cf75a6c4b70069b1fc5379b19a2da01bb54e6.zip | |
Check for null pointer
(bzr r399)
Diffstat (limited to 'src/ui/widget/selected-style.cpp')
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 066d72175..f5b1fa08f 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -887,24 +887,27 @@ SelectedStyle::update() } else if (paint->set && paint->type == SP_PAINT_TYPE_PAINTSERVER) { SPPaintServer *server = (i == SS_FILL)? SP_STYLE_FILL_SERVER (query) : SP_STYLE_STROKE_SERVER (query); - - Inkscape::XML::Node *srepr = SP_OBJECT_REPR(server); - _paintserver_id[i] += "url(#"; - _paintserver_id[i] += srepr->attribute("id"); - _paintserver_id[i] += ")"; - - if (SP_IS_LINEARGRADIENT (server)) { - place->add(_lgradient[i]); - _tooltips.set_tip(*place, __lgradient[i]); - _mode[i] = SS_LGRADIENT; - } else if (SP_IS_RADIALGRADIENT (server)) { - place->add(_rgradient[i]); - _tooltips.set_tip(*place, __rgradient[i]); - _mode[i] = SS_RGRADIENT; - } else if (SP_IS_PATTERN (server)) { - place->add(_pattern[i]); - _tooltips.set_tip(*place, __pattern[i]); - _mode[i] = SS_PATTERN; + if ( server ) { + Inkscape::XML::Node *srepr = SP_OBJECT_REPR(server); + _paintserver_id[i] += "url(#"; + _paintserver_id[i] += srepr->attribute("id"); + _paintserver_id[i] += ")"; + + if (SP_IS_LINEARGRADIENT (server)) { + place->add(_lgradient[i]); + _tooltips.set_tip(*place, __lgradient[i]); + _mode[i] = SS_LGRADIENT; + } else if (SP_IS_RADIALGRADIENT (server)) { + place->add(_rgradient[i]); + _tooltips.set_tip(*place, __rgradient[i]); + _mode[i] = SS_RGRADIENT; + } else if (SP_IS_PATTERN (server)) { + place->add(_pattern[i]); + _tooltips.set_tip(*place, __pattern[i]); + _mode[i] = SS_PATTERN; + } + } else { + g_warning ("file %s: line %d: Unknown paint server", __FILE__, __LINE__); } } else if (paint->set && paint->type == SP_PAINT_TYPE_NONE) { |
