Revision 37963 trunk/libraries/libRaster/src/org/gvsig/raster/util/Cancellable.java

View differences:

Cancellable.java
45 45
	public Cancellable(Object obj) {
46 46
		try {
47 47
			this.obj = obj;
48
			method = obj.getClass().getMethod("isCanceled", null);
48
			if (obj != null) {
49
				method = obj.getClass().getMethod("isCanceled", null);
50
			}
49 51
		} catch (SecurityException e) {
50 52
			// TODO Auto-generated catch block
51 53
			e.printStackTrace();
......
58 60
	public boolean isCanceled() {
59 61
		Object ret = false;
60 62
		try {
61
			ret = method.invoke(obj, null);
63
			if (method != null)
64
				ret = method.invoke(obj, null);
62 65
		} catch (IllegalArgumentException e) {
63 66
			e.printStackTrace();
64 67
		} catch (IllegalAccessException e) {

Also available in: Unified diff