Skip to content

Commit 3c45eb2

Browse files
committed
fix(get): 修复获取首个Manager会出现报错的问题
1 parent 6456f0d commit 3c45eb2

File tree

8 files changed

+10
-8
lines changed

8 files changed

+10
-8
lines changed

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>minesql-parent</artifactId>
77
<groupId>cc.carm.plugin</groupId>
8-
<version>1.2.1</version>
8+
<version>1.2.2</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>minesql-parent</artifactId>
77
<groupId>cc.carm.plugin</groupId>
8-
<version>1.2.1</version>
8+
<version>1.2.2</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111
<properties>

core/src/main/java/cc/carm/plugin/minesql/MineSQLRegistry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ protected HashMap<String, SQLManager> getManagers() {
2121

2222
@Override
2323
public @NotNull Optional<@Nullable SQLManager> getOptional(@Nullable String id) {
24-
return Optional.of(this.managers.get(id));
24+
if (id != null) return Optional.of(this.managers.get(id));
25+
else if (managers.isEmpty()) return Optional.empty();
26+
else return Optional.ofNullable(managers.values().iterator().next());
2527
}
2628

2729
@Override

platforms/bukkit/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>minesql-parent</artifactId>
77
<groupId>cc.carm.plugin</groupId>
8-
<version>1.2.1</version>
8+
<version>1.2.2</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

platforms/bungee/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>minesql-parent</artifactId>
77
<groupId>cc.carm.plugin</groupId>
8-
<version>1.2.1</version>
8+
<version>1.2.2</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

platforms/velocity/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>minesql-parent</artifactId>
77
<groupId>cc.carm.plugin</groupId>
8-
<version>1.2.1</version>
8+
<version>1.2.2</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>

plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>minesql-parent</artifactId>
77
<groupId>cc.carm.plugin</groupId>
8-
<version>1.2.1</version>
8+
<version>1.2.2</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111
<properties>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<groupId>cc.carm.plugin</groupId>
2525
<artifactId>minesql-parent</artifactId>
2626
<packaging>pom</packaging>
27-
<version>1.2.1</version>
27+
<version>1.2.2</version>
2828
<modules>
2929
<module>api</module>
3030
<module>core</module>

0 commit comments

Comments
 (0)