src/ldtypes.cpp

changeset 486
25747c37c7be
parent 484
5b5c77c7f3dd
child 489
0b32138fedcc
child 493
16766ac1bbd9
--- a/src/ldtypes.cpp	Wed Sep 04 11:34:19 2013 +0300
+++ b/src/ldtypes.cpp	Wed Sep 04 11:54:17 2013 +0300
@@ -647,8 +647,9 @@
 // makes history stuff work out of the box.
 // -----------------------------------------------------------------------------
 template<class T> void changeProperty (LDObject* obj, T* ptr, const T& val) {
-	if (obj->file()) {
-		long idx = obj->getIndex();
+	long idx;
+	
+	if (obj->file() && (idx = obj->getIndex()) != -1) {
 		str before = obj->raw();
 		*ptr = val;
 		str after = obj->raw();

mercurial