[gnome-subtitles] Only emmit the command if there are connected handlers



commit 657eff1c4c141236151a4fb631e46d85f14acf13
Author: Pedro Castro <mail pedrocastro org>
Date:   Sun Jun 7 19:40:23 2009 +0100

    Only emmit the command if there are connected handlers
---
 src/GnomeSubtitles/Core/Command/CommandManager.cs |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/GnomeSubtitles/Core/Command/CommandManager.cs b/src/GnomeSubtitles/Core/Command/CommandManager.cs
index 906b673..dda8a12 100644
--- a/src/GnomeSubtitles/Core/Command/CommandManager.cs
+++ b/src/GnomeSubtitles/Core/Command/CommandManager.cs
@@ -181,7 +181,9 @@ public class CommandManager {
 	}
 	
 	private void EmitCommandActivated (Command command) {
-		CommandActivated(this, new CommandActivatedArgs(command.Target));
+		if (CommandActivated != null) {
+			CommandActivated(this, new CommandActivatedArgs(command.Target));
+		}
 	}
 	
 	private Command GetNextCommand () {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]