codemetropolis / CodeMetropolis

See your software as never before.
http://codemetropolis.github.io/CodeMetropolis/
14 stars 30 forks source link

Rendering with invalid world parameter is not handled correctly #319

Open hmariann opened 2 years ago

hmariann commented 2 years ago

Pre-requisites:

Steps:

  1. Run "java -jar rendering-1.4.0.jar -i placingToRendering.xml -w W:/CM"

Expected result:

The tool warns the user that the world path parameter value is invalid and exits normally without creating the output files.

Test result:

    The tool halts unexpectedly with the following stack trace on the console output:
    "java.io.FileNotFoundException: W:\CM\level.dat (A rendszer nem találja a megadott elérési utat)
    at java.io.RandomAccessFile.open0(Native Method)
    at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
    at codemetropolis.blockmodifier.ext.LevelFile.<init>(LevelFile.java:15)
    at codemetropolis.blockmodifier.Level.<init>(Level.java:17)
    at codemetropolis.blockmodifier.World.<init>(World.java:26)
    at codemetropolis.toolchain.rendering.control.WorldBuilder.<init>(WorldBuilder.java:37)
    at codemetropolis.toolchain.rendering.RenderingExecutor.execute(RenderingExecutor.java:67)
    at codemetropolis.toolchain.rendering.Main.main(Main.java:73)

java.io.FileNotFoundException: W:\CM\level.dat (A rendszer nem találja a megadott elérési utat) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.(FileOutputStream.java:213) at java.io.FileOutputStream.(FileOutputStream.java:162) at codemetropolis.blockmodifier.ext.LevelFile.getLevelDataOutputStream(LevelFile.java:34) at codemetropolis.blockmodifier.Level.writeToFile(Level.java:74) at codemetropolis.blockmodifier.World.(World.java:27) at codemetropolis.toolchain.rendering.control.WorldBuilder.(WorldBuilder.java:37) at codemetropolis.toolchain.rendering.RenderingExecutor.execute(RenderingExecutor.java:67) at codemetropolis.toolchain.rendering.Main.main(Main.java:73) Exception in thread "main" java.lang.NullPointerException at java.io.DataOutputStream.writeByte(DataOutputStream.java:153) at codemetropolis.blockmodifier.ext.NBTTag.writeTo(NBTTag.java:407) at codemetropolis.blockmodifier.Level.writeToFile(Level.java:74) at codemetropolis.blockmodifier.World.(World.java:27) at codemetropolis.toolchain.rendering.control.WorldBuilder.(WorldBuilder.java:37) at codemetropolis.toolchain.rendering.RenderingExecutor.execute(RenderingExecutor.java:67) at codemetropolis.toolchain.rendering.Main.main(Main.java:73)". The log file does not contain

Related TC:

TG_004.TC_011