/*
 * The MIT License
 *
 * Copyright 2017 Fernando van Loenhout.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package me.ferrybig.javacoding.teamspeakconnector.repository;

import io.netty.util.concurrent.Future;
import me.ferrybig.javacoding.teamspeakconnector.Resolvable;

public abstract class AbstractResolvable<
		S extends Resolvable<? extends T>, T extends S, R extends BaseResolvableRepository<S, T>>
		implements Resolvable<T> {

	protected final R repo;

	public AbstractResolvable(R repository) {
		this.repo = repository;
	}

	@Override
	public boolean isResolved() {
		return false;
	}

	@Override
	public Future<T> resolve() {
		if (isResolved()) {
			return repo.getConnection().io().getCompletedFuture((T) this);
		}
		return repo.get((S) this);
	}

	@Override
	public Future<T> forceResolve() {
		return repo.get((S) this, true);
	}

	public Future<?> delete(boolean force) {
		return repo.deleteUnresolved((S) this, force);
	}

}

@@ -1241,16 +1241,42 @@
 Future;%0A
+import java.util.Objects;%0A
 import m
@@ -1552,22 +1552,16 @@
 e(R repo
-sitory
 ) %7B%0A%09%09th
@@ -1570,26 +1570,52 @@
 .repo = 
-repository
+Objects.requireNonNull(repo, %22repo%22)
 ;%0A%09%7D%0A%0A%09@

Add null check