Skip to content

Commit 69f3e8f

Browse files
committed
fix exception bug in UrlsController.create() again
1 parent ef52124 commit 69f3e8f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/src/main/java/hexlet/code/controller/UrlsController.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.net.URI;
1414
import java.net.URISyntaxException;
1515
import java.sql.SQLException;
16-
import java.util.Objects;
1716

1817
import static io.javalin.rendering.template.TemplateUtil.model;
1918

@@ -48,10 +47,7 @@ public static void show(Context ctx) throws SQLException {
4847

4948
public static void create(Context ctx) throws SQLException {
5049

51-
var inputUrl = ctx.formParamAsClass("url", String.class)
52-
.check(Objects::nonNull, "Url not found in form")
53-
.getOrThrow(NotFoundResponse::new);
54-
50+
var inputUrl = ctx.formParam("url");
5551
URI parsedUrl;
5652
try {
5753
parsedUrl = new URI(inputUrl);

0 commit comments

Comments
 (0)