Merge lp:~inkscape.dev/inkscape/npdfix into lp:~inkscape.dev/inkscape/trunk

Proposed by Kris
Status: Merged
Merged at revision: 14476
Proposed branch: lp:~inkscape.dev/inkscape/npdfix
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 20 lines (+3/-5)
1 file modified
src/ui/interface.cpp (+3/-5)
To merge this branch: bzr merge lp:~inkscape.dev/inkscape/npdfix
Reviewer Review Type Date Requested Status
Mc Approve
Review via email: mp+277634@code.launchpad.net

Description of the change

Found this part with possible null pointer dereference and made a proposal to fix it.

I would appreciate it:
if anyone could review it and
if you could change the code directly in case there are drawbacks to the suggested fix

To post a comment you must log in.
Revision history for this message
Mc (mc...) wrote :

Functionally equivalent code.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ui/interface.cpp'
2--- src/ui/interface.cpp 2015-09-16 18:22:07 +0000
3+++ src/ui/interface.cpp 2015-11-16 22:21:40 +0000
4@@ -846,13 +846,11 @@
5 #endif
6 }
7 } else if (menu_pntr->attribute("check") != NULL) {
8- SPAction *action = NULL;
9 if (verb->get_code() != SP_VERB_NONE) {
10- action = verb->get_action(Inkscape::ActionContext(view));
11- }
12- sp_ui_menu_append_check_item_from_verb(GTK_MENU(menu), view, action->name, action->tip, NULL,
13+ SPAction *action = verb->get_action(Inkscape::ActionContext(view));
14+ sp_ui_menu_append_check_item_from_verb(GTK_MENU(menu), view, action->name, action->tip, NULL,
15 checkitem_toggled, checkitem_update, verb);
16-
17+ }
18 } else {
19 sp_ui_menu_append_item_from_verb(GTK_MENU(menu), verb, view);
20 group = NULL;