Révision 1714

tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/VectorImpl.java (revision 1714)
220 220
	@Override
221 221
	public int[] asIntArray() throws RWorkspaceException {
222 222
		try {
223
			return rw.eval(symbol).asIntegers();
223
			REXP rexp = rw.eval(symbol);
224
			if (rexp.isNull()) {
225
				return new int[0];
226
			}
227
			return rexp.asIntegers();
224 228
		} catch (REXPMismatchException e) {
225 229
			throw new RWorkspaceException(e);
226 230
		}
......
232 236
	@Override
233 237
	public String[] asStringsArray() throws StatException {
234 238
		try {
235
			return rw.eval(symbol).asStrings();
239
			REXP rexp = rw.eval(symbol);
240
			if (rexp.isNull()) {
241
				return new String[0];
242
			}
243
			return rexp.asStrings();
236 244
		} catch (REXPMismatchException e) {
237 245
			throw new RWorkspaceException(e);
238 246
		}
......
244 252
	@Override
245 253
	public double[] asDoubleArray() throws StatException {
246 254
		try {
247
			return rw.eval(symbol).asDoubles();
255
			REXP rexp = rw.eval(symbol);
256
			if (rexp.isNull()) {
257
				return new double[0];
258
			}
259
			return rexp.asDoubles();
248 260
		} catch (REXPMismatchException e) {
249 261
			throw new RWorkspaceException(e);
250 262
		}

Formats disponibles : Unified diff