diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2021-02-18 12:53:04 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2021-02-18 12:53:04 +0100 |
commit | 7b6f128a25c5ca245f46247ba40572672cdf400b (patch) | |
tree | 604832b3cffdf20b13a5b1a09434e9a806cf3674 /src/scanner.vala | |
parent | ee6f7618785519daa986955db561166cc58a3633 (diff) | |
parent | c2bb4f98199d9054f82b538ff44f895a8399bb28 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/scanner.vala')
-rw-r--r-- | src/scanner.vala | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/scanner.vala b/src/scanner.vala index becb9fa..237e1eb 100644 --- a/src/scanner.vala +++ b/src/scanner.vala @@ -662,10 +662,12 @@ public class Scanner : Object switch (option.constraint_type) { case Sane.ConstraintType.RANGE: - if (option.type == Sane.ValueType.FIXED) - s += " min=%f, max=%f, quant=%d".printf (Sane.UNFIX (option.range.min), Sane.UNFIX (option.range.max), (int) option.range.quant); - else - s += " min=%d, max=%d, quant=%d".printf ((int) option.range.min, (int) option.range.max, (int) option.range.quant); + if (option.range != null) { + if (option.type == Sane.ValueType.FIXED) + s += " min=%f, max=%f, quant=%d".printf (Sane.UNFIX (option.range.min), Sane.UNFIX (option.range.max), (int) option.range.quant); + else + s += " min=%d, max=%d, quant=%d".printf ((int) option.range.min, (int) option.range.max, (int) option.range.quant); + } break; case Sane.ConstraintType.WORD_LIST: s += " values=["; @@ -682,11 +684,13 @@ public class Scanner : Object break; case Sane.ConstraintType.STRING_LIST: s += " values=["; - for (var i = 0; option.string_list[i] != null; i++) - { - if (i != 0) - s += ", "; - s += "\"%s\"".printf (option.string_list[i]); + if (option.string_list != null) { + for (var i = 0; option.string_list[i] != null; i++) + { + if (i != 0) + s += ", "; + s += "\"%s\"".printf (option.string_list[i]); + } } s += "]"; break; @@ -1422,6 +1426,10 @@ public class Scanner : Object if (status == Sane.Status.NO_DOCS) { do_complete_document (); + if (page_number == 0) + fail_scan (status, + /* Error displayed when no documents at the start of scanning */ + _("Document feeder empty")); return; } |