Code

add document to action events (when possible)
authormental <mental@users.sourceforge.net>
Thu, 10 May 2007 01:19:01 +0000 (01:19 +0000)
committermental <mental@users.sourceforge.net>
Thu, 10 May 2007 01:19:01 +0000 (01:19 +0000)
src/helper/action.cpp

index 9b8cbfce80e3500e26cedd4c499f209957496609..84d150615388fcae9c58853087dd77c0543e1fe8 100644 (file)
@@ -131,9 +131,11 @@ public:
     : ActionEventBase(share_static_string("action"))
     {
         _addProperty(share_static_string("timestamp"), timestamp());
-        SPDocument *document = action->view->doc();
-        if (document) {
-            _addProperty(share_static_string("document"), document->serial());
+        if (action->view) {
+            SPDocument *document = action->view->doc();
+            if (document) {
+                _addProperty(share_static_string("document"), document->serial());
+            }
         }
         _addProperty(share_static_string("verb"), action->id);
     }