summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2018-07-16 01:36:01 +0200
committerSebastian Reichel <sre@ring0.de>2018-07-17 12:17:08 +0200
commit60e7aea9c4501213f8710b0f14bf3e3ba35e8d7a (patch)
treee206affebbdee63f65fb8443111f5ba1bc15d4bc /src
parentd6cc1e7da591f784bddecce19e12097de88d0fe8 (diff)
downloadserial-barcode-scanner-60e7aea9c4501213f8710b0f14bf3e3ba35e8d7a.tar.bz2
Fix display of Guest purchases
Diffstat (limited to 'src')
-rw-r--r--src/scanner-session/scannersession.vala18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/scanner-session/scannersession.vala b/src/scanner-session/scannersession.vala
index cf308ce..494ecbd 100644
--- a/src/scanner-session/scannersession.vala
+++ b/src/scanner-session/scannersession.vala
@@ -59,13 +59,19 @@ public class ScannerSessionImplementation {
private bool login(int user) throws DBusError, IOError {
this.user = user;
- try {
- this.name = db.get_username(user);
- this.disabled = db.user_is_disabled(user);
- } catch(DatabaseError e) {
- send_message(MessageType.ERROR, _("Error (user=%d): %s"), user, e.message);
- return false;
+ if (user != 0) {
+ try {
+ this.name = db.get_username(user);
+ this.disabled = db.user_is_disabled(user);
+ } catch(DatabaseError e) {
+ send_message(MessageType.ERROR, _("Error (user=%d): %s"), user, e.message);
+ return false;
+ }
+ } else {
+ this.name = _("Guest");
+ this.disabled = false;
}
+
this.logged_in = true;
try {