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 fd58566 commit 6adee66Copy full SHA for 6adee66
libanki/src/main/java/com/ichi2/anki/libanki/Media.kt
@@ -73,11 +73,9 @@ open class Media(
73
*/
74
@LibAnkiAlias("add_file")
75
@RustCleanup("use backend exception instead of EmptyMediaException")
76
- fun addFile(file: File?): String {
+ fun addFile(file: File): String {
77
// fail if non-existing or empty
78
- if (file == null || file.length() == 0L) {
79
- throw EmptyMediaException()
80
- }
+ if (file.length() == 0L) throw EmptyMediaException()
81
return writeData(file.name, file.readBytes().toByteString())
82
}
83
0 commit comments