Skip to content

Commit

Permalink
PAINTROID-621_command_serializer_null_pointer (#1321)
Browse files Browse the repository at this point in the history
IOException instead of NullPointerException (handled in FileIO.kt)

Co-authored-by: Julian Raphael Jautz <[email protected]>
  • Loading branch information
JulianJautz and Julian Raphael Jautz authored Nov 21, 2024
1 parent fc3e938 commit 6b433fd
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import org.catrobat.paintroid.FileIO
import org.catrobat.paintroid.command.implementation.ClipboardCommand
import java.io.IOException

class ClipboardCommandSerializer(version: Int) : VersionSerializer<ClipboardCommand>(version) {

Expand Down Expand Up @@ -61,6 +62,7 @@ class ClipboardCommandSerializer(version: Int) : VersionSerializer<ClipboardComm
val width = readFloat()
val height = readFloat()
val rotation = readFloat()
if (bitmap == null) throw IOException("Bitmap is null! Can not create ClipboardCommand.")
ClipboardCommand(bitmap, coordinates, width, height, rotation)
}
}
Expand Down

0 comments on commit 6b433fd

Please sign in to comment.