Fix null value crash

This commit is contained in:
JeremyStar™ 2024-10-15 04:06:31 +02:00
parent f4019455cc
commit 25a944baf4
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 8 additions and 8 deletions

View file

@ -109,14 +109,14 @@ public final class GlfwWindow extends Window {
* @throws Exception stuff thrown by the {@link #initializeWindow()} and {@link #render()} methods of the implementing windowing API * @throws Exception stuff thrown by the {@link #initializeWindow()} and {@link #render()} methods of the implementing windowing API
* @since v1-alpha2 * @since v1-alpha2
*/ */
public GlfwWindow(@NotNull String name, @NotNull String title, @NotNull Path @Nullable [] icons, @NotNull Vec2i size, @NotNull Vec2i minimumSize, @NotNull Vec2i maximumSize, @NotNull Vec2i position, @NotNull WindowMode windowMode, @NotNull Monitor monitor, boolean resizable, boolean borderless, boolean focusable, boolean onTop, boolean transparent, boolean rendering) throws Exception { public GlfwWindow(@NotNull String name, @NotNull String title, @Nullable Path @NotNull [] icons, @NotNull Vec2i size, @NotNull Vec2i minimumSize, @NotNull Vec2i maximumSize, @NotNull Vec2i position, @NotNull WindowMode windowMode, @NotNull Monitor monitor, boolean resizable, boolean borderless, boolean focusable, boolean onTop, boolean transparent, boolean rendering) throws Exception {
super(name, title, icons, size, minimumSize, maximumSize, position, windowMode, monitor, resizable, borderless, focusable, onTop, transparent, rendering); super(name, title, icons, size, minimumSize, maximumSize, position, windowMode, monitor, resizable, borderless, focusable, onTop, transparent, rendering);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
protected void initializeWindow() { protected void initializeWindow() {
createGlfwWindow(); // Create the GLFW window createGlfwWindow();
} }
/** /**
@ -356,7 +356,7 @@ public final class GlfwWindow extends Window {
/** {@inheritDoc} */ /** {@inheritDoc} */
@ApiStatus.Experimental @ApiStatus.Experimental
@Override @Override
public void setIcons(@NotNull Path @Nullable [] icons) { public void setIcons(@Nullable Path @NotNull [] icons) {
getLogger().warn("GlfwWindow#setIcons is experimental and may cause engine or JVM crashes. Here be dragons!"); getLogger().warn("GlfwWindow#setIcons is experimental and may cause engine or JVM crashes. Here be dragons!");
// Ensure the window is not terminated // Ensure the window is not terminated

View file

@ -222,7 +222,7 @@ public abstract class Window implements AutoCloseable {
* @since v1-alpha6 * @since v1-alpha6
*/ */
@Setter @Setter
private @NotNull Path @Nullable [] icons; private @Nullable Path @NotNull [] icons;
/** /**
* Contains the size of this window. * Contains the size of this window.
@ -508,7 +508,7 @@ public abstract class Window implements AutoCloseable {
* @throws Exception stuff thrown by the {@link #initializeWindow()} and {@link #render()} methods of the implementing windowing API * @throws Exception stuff thrown by the {@link #initializeWindow()} and {@link #render()} methods of the implementing windowing API
* @since v1-alpha2 * @since v1-alpha2
*/ */
protected Window(@NotNull String name, @NotNull String title, @NotNull Path @Nullable [] icons, @NotNull Vec2i size, @NotNull Vec2i minimumSize, @NotNull Vec2i maximumSize, @NotNull Vec2i position, @NotNull WindowMode windowMode, @NotNull Monitor monitor, boolean resizable, boolean borderless, boolean focusable, boolean onTop, boolean transparent, boolean rendering) throws Exception { protected Window(@NotNull String name, @NotNull String title, @Nullable Path @NotNull [] icons, @NotNull Vec2i size, @NotNull Vec2i minimumSize, @NotNull Vec2i maximumSize, @NotNull Vec2i position, @NotNull WindowMode windowMode, @NotNull Monitor monitor, boolean resizable, boolean borderless, boolean focusable, boolean onTop, boolean transparent, boolean rendering) throws Exception {
// Initialize variables // Initialize variables
this.uniqueIdentifier = UUID.randomUUID(); this.uniqueIdentifier = UUID.randomUUID();
this.name = name; this.name = name;
@ -657,7 +657,7 @@ public abstract class Window implements AutoCloseable {
* @see Window#icons * @see Window#icons
* @since v1-alpha6 * @since v1-alpha6
*/ */
private @NotNull Path @Nullable [] icons = null; private @Nullable Path @NotNull [] icons = null;
/** /**
* Contains the window size. * Contains the window size.
@ -849,7 +849,7 @@ public abstract class Window implements AutoCloseable {
* @see Window#icons * @see Window#icons
* @since v1-alpha6 * @since v1-alpha6
*/ */
public @NotNull Path @Nullable [] getIcons() { public @Nullable Path @NotNull [] getIcons() {
return icons; return icons;
} }
@ -1020,7 +1020,7 @@ public abstract class Window implements AutoCloseable {
* @see Window#icons * @see Window#icons
* @since v1-alpha6 * @since v1-alpha6
*/ */
public @NotNull Builder setIcons(@NotNull Path @Nullable [] icons) { public @NotNull Builder setIcons(@Nullable Path @NotNull [] icons) {
this.icons = icons; this.icons = icons;
return this; return this;
} }