*/
public class Rygel.CmdlineConfig : GLib.Object, Configuration {
private static string host_ip;
- private static int port;
+ private static int port = -1;
private static bool no_transcoding;
private static bool no_mp3_trans;
}
public int get_port () throws GLib.Error {
+ if (this.port == -1) {
+ throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ }
+
return port;
}
throws GLib.Error {
int val = this.key_file.get_integer (section, key);
- if (val < min || val > max) {
+ if (val == 0 || val < min || val > max) {
throw new ConfigurationError.VALUE_OUT_OF_RANGE (
"Value of '%s' out of range", key);
}