[anjuta] language-support-vala: don't assert a Document is always an Editor
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] language-support-vala: don't assert a Document is always an Editor
- Date: Sun, 27 Feb 2011 21:44:32 +0000 (UTC)
commit 03206be64071431c5a1367a56d9c73cd80cbcf42
Author: Abderrahim Kitouni <akitouni src gnome org>
Date: Fri Feb 4 21:09:16 2011 +0100
language-support-vala: don't assert a Document is always an Editor
this is obviously false for a glade document.
plugins/language-support-vala/plugin.vala | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/language-support-vala/plugin.vala b/plugins/language-support-vala/plugin.vala
index a4489fa..a457e53 100644
--- a/plugins/language-support-vala/plugin.vala
+++ b/plugins/language-support-vala/plugin.vala
@@ -174,7 +174,10 @@ public class ValaPlugin : Plugin {
public void editor_value_added (Anjuta.Plugin plugin, string name, Value value) {
debug("editor value added");
assert (current_editor == null);
- assert (value.get_object() is IAnjuta.Editor);
+ if (!(value.get_object() is IAnjuta.Editor)) {
+ /* a glade document, for example, isn't an editor */
+ return;
+ }
current_editor = value.get_object() as IAnjuta.Editor;
var current_file = value.get_object() as IAnjuta.File;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]