We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44dc60f commit 5c636b3Copy full SHA for 5c636b3
src/main/java/org/algorithm_visualizer/Extractor.java
@@ -13,6 +13,7 @@
13
import java.io.InputStreamReader;
14
import java.io.Writer;
15
import java.nio.file.Files;
16
+import java.nio.file.Path;
17
import java.nio.file.Paths;
18
import java.util.ArrayList;
19
import java.util.List;
@@ -31,8 +32,12 @@ public Response handleRequest(String code, Context context) {
31
32
compile(sourceFile);
33
run(tmpDir);
34
- String commands = new String(Files.readAllBytes(Paths.get(tmpDir.toString(), "visualization.json")));
35
+ Path visualizationPath = Paths.get(tmpDir.toString(), "visualization.json");
36
+ if (!visualizationPath.toFile().exists())
37
+ throw new Exception("Visualization Not Found");
38
+ String commands = new String(Files.readAllBytes(visualizationPath));
39
return new Response(commands);
40
+
41
} catch (Exception e) {
42
return new Response(e);
43
}
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments