summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-05-03 16:58:21 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-05-03 16:58:21 +0000
commitc5d39b714d9d5f79442a4632eef9a8db54b0f7d5 (patch)
treeb820eb3de300bdc5ff3ec2b8fdb73bf4c3339b65 /src/extension/implementation/script.cpp
parentCorrected hardcoded hit detection in pen & pencil tool endpoint detection. (diff)
downloadinkscape-c5d39b714d9d5f79442a4632eef9a8db54b0f7d5.tar.gz
inkscape-c5d39b714d9d5f79442a4632eef9a8db54b0f7d5.zip
Syntax of null pointer dereference checking
(bzr r11320)
Diffstat (limited to 'src/extension/implementation/script.cpp')
-rw-r--r--src/extension/implementation/script.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 7db036477..432b25bb9 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -738,10 +738,12 @@ void Script::effect(Inkscape::Extension::Effect *module,
SPNamedView *nv = (SPNamedView *) obj;
//Check if it has a default layer set up
- if ( nv != NULL and nv->default_layer_id != 0 ) {
- SPDocument *document = desktop->doc();
- //If so, get that layer
- layer = document->getObjectById(g_quark_to_string(nv->default_layer_id));
+ if ( nv != NULL){
+ if( nv->default_layer_id != 0 ) {
+ SPDocument *document = desktop->doc();
+ //If so, get that layer
+ layer = document->getObjectById(g_quark_to_string(nv->default_layer_id));
+ }
}
sp_namedview_update_layers_from_document(desktop);