1
mirror of https://github.com/CarmJos/MineSQL.git synced 2024-09-19 20:25:45 +00:00

fix(get): 修复获取首个Manager会出现报错的问题

This commit is contained in:
Carm Jos 2023-01-14 17:28:45 +08:00
parent 6456f0d2fe
commit 3c45eb29bf
8 changed files with 10 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.2.1</version>
<version>1.2.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.2.1</version>
<version>1.2.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>

View File

@ -21,7 +21,9 @@ public class MineSQLRegistry implements SQLRegistry {
@Override
public @NotNull Optional<@Nullable SQLManager> getOptional(@Nullable String id) {
return Optional.of(this.managers.get(id));
if (id != null) return Optional.of(this.managers.get(id));
else if (managers.isEmpty()) return Optional.empty();
else return Optional.ofNullable(managers.values().iterator().next());
}
@Override

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.2.1</version>
<version>1.2.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>minesql-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.2.1</version>
<version>1.2.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>

View File

@ -24,7 +24,7 @@
<groupId>cc.carm.plugin</groupId>
<artifactId>minesql-parent</artifactId>
<packaging>pom</packaging>
<version>1.2.1</version>
<version>1.2.2</version>
<modules>
<module>api</module>
<module>core</module>