Skip to content

Commit e41196c

Browse files
committed
chore: update VK.java
1 parent 9a0df88 commit e41196c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • modules/overrungl.vulkan/src/main/java/overrungl/vulkan

modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VK.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import overrungl.util.MemoryUtil;
2121

2222
import java.lang.foreign.MemorySegment;
23+
import java.util.Objects;
2324

2425
/**
2526
* This class loads the Vulkan library into the JVM process.
@@ -108,9 +109,6 @@ private MemorySegment getFunctionAddress(String name, boolean required) {
108109

109110
/// {@return instance of [GlobalCommands]}
110111
public static GlobalCommands globalCommands() {
111-
if (globalCommands == null) {
112-
throw new NullPointerException("globalCommands is null; call VK::create first");
113-
}
114-
return globalCommands;
112+
return Objects.requireNonNull(globalCommands, "Global commands are not loaded; call VK::create first");
115113
}
116114
}

0 commit comments

Comments
 (0)