Added null check to Arrays.copyOf() in ResourceDataSource.