Index: topia2/src/java/org/codelutin/topia/persistence/TopiaEntityAbstract.java diff -u topia2/src/java/org/codelutin/topia/persistence/TopiaEntityAbstract.java:1.12 topia2/src/java/org/codelutin/topia/persistence/TopiaEntityAbstract.java:1.13 --- topia2/src/java/org/codelutin/topia/persistence/TopiaEntityAbstract.java:1.12 Mon Oct 23 15:01:58 2006 +++ topia2/src/java/org/codelutin/topia/persistence/TopiaEntityAbstract.java Tue Oct 24 07:52:21 2006 @@ -23,9 +23,9 @@ * * @author poussin * - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ * - * Last update: $Date: 2006/10/23 15:01:58 $ by : $Author: ruchaud $ + * Last update: $Date: 2006/10/24 07:52:21 $ by : $Author: ruchaud $ */ package org.codelutin.topia.persistence; @@ -208,32 +208,44 @@ protected void fireOnPreRead(String propertyName, Object value) { TopiaContextImplementor contextImplementor = (TopiaContextImplementor) getTopiaContext(); - contextImplementor.getFiresSupport().fireOnPreRead(readVetoables, this, propertyName, value); + if(contextImplementor != null) { + contextImplementor.getFiresSupport().fireOnPreRead(readVetoables, this, propertyName, value); + } } protected void fireOnPostRead(String propertyName, Object value) { TopiaContextImplementor contextImplementor = (TopiaContextImplementor) getTopiaContext(); - contextImplementor.getFiresSupport().fireOnPostRead(readListeners, this, propertyName, value); + if(contextImplementor != null) { + contextImplementor.getFiresSupport().fireOnPostRead(readListeners, this, propertyName, value); + } } protected void fireOnPostRead(String propertyName, int index, Object value) { TopiaContextImplementor contextImplementor = (TopiaContextImplementor) getTopiaContext(); - contextImplementor.getFiresSupport().fireOnPostRead(readListeners, this, propertyName, index, value); + if(contextImplementor != null) { + contextImplementor.getFiresSupport().fireOnPostRead(readListeners, this, propertyName, index, value); + } } protected void fireOnPreWrite(String propertyName, Object oldValue, Object newValue) { TopiaContextImplementor contextImplementor = (TopiaContextImplementor) getTopiaContext(); - contextImplementor.getFiresSupport().fireOnPreWrite(writeVetoables, this, propertyName, oldValue, newValue); + if(contextImplementor != null) { + contextImplementor.getFiresSupport().fireOnPreWrite(writeVetoables, this, propertyName, oldValue, newValue); + } } protected void fireOnPostWrite(String propertyName, Object oldValue, Object newValue) { TopiaContextImplementor contextImplementor = (TopiaContextImplementor) getTopiaContext(); - contextImplementor.getFiresSupport().fireOnPostWrite(writeListeners, this, propertyName, oldValue, newValue); + if(contextImplementor != null) { + contextImplementor.getFiresSupport().fireOnPostWrite(writeListeners, this, propertyName, oldValue, newValue); + } } protected void fireOnPostWrite(String propertyName, int index, Object oldValue, Object newValue) { TopiaContextImplementor contextImplementor = (TopiaContextImplementor) getTopiaContext(); - contextImplementor.getFiresSupport().fireOnPostWrite(writeListeners, this, propertyName, index, oldValue, newValue); + if(contextImplementor != null) { + contextImplementor.getFiresSupport().fireOnPostWrite(writeListeners, this, propertyName, index, oldValue, newValue); + } } public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {