Skip to content

Commit d42726e

Browse files
authored
Merge pull request #3 from maiqingqiang/v1.0.2
🐛 Fix the verify SQL exception.
2 parents 1d4f34c + 5fff802 commit d42726e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## [Unreleased]
66

7+
## [1.0.2] - 2023-07-04
8+
9+
### Fixed
10+
- Fix the verify SQL exception.
11+
712
## [1.0.1] - 2023-07-03
813

914
### Fixed
@@ -20,6 +25,7 @@
2025
- ORM Code Completion
2126
- SQL to Struct
2227

23-
[Unreleased]: https://github.com/maiqingqiang/go-orm-helper/compare/v1.0.1...HEAD
28+
[Unreleased]: https://github.com/maiqingqiang/go-orm-helper/compare/v1.0.2...HEAD
29+
[1.0.2]: https://github.com/maiqingqiang/go-orm-helper/compare/v1.0.1...v1.0.2
2430
[1.0.1]: https://github.com/maiqingqiang/go-orm-helper/compare/v1.0.0...v1.0.1
2531
[1.0.0]: https://github.com/maiqingqiang/go-orm-helper/tree/v1.0.0

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = com.github.maiqingqiang.goormhelper
44
pluginName = Go ORM Helper
55
pluginRepositoryUrl = https://github.com/maiqingqiang/go-orm-helper
66
# SemVer format -> https://semver.org
7-
pluginVersion = 1.0.1
7+
pluginVersion = 1.0.2
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 222

src/main/java/com/github/maiqingqiang/goormhelper/actions/EditorPasteListener.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ protected void doExecute(@NotNull Editor editor, @Nullable Caret caret, DataCont
8686
}
8787

8888
private boolean verifySQL(String sql) {
89-
Validation validation = new Validation(Collections.singletonList(FeaturesAllowed.CREATE), sql);
90-
List<ValidationError> errors = validation.validate();
89+
try {
90+
Validation validation = new Validation(Collections.singletonList(FeaturesAllowed.CREATE), sql);
91+
List<ValidationError> errors = validation.validate();
9192

92-
return errors.size() == 0;
93+
return errors.size() == 0;
94+
} catch (Exception e) {
95+
return false;
96+
}
9397
}
9498

9599
}

0 commit comments

Comments
 (0)