Add error message when trying to dump a non-existent tiddler

print-window-tiddler
Jeremy Ruston 2013-01-06 21:38:38 +00:00
rodzic 698f8dd602
commit 41e8942b0c
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -42,6 +42,9 @@ Command.prototype.subcommands.tiddler = function() {
return "Too few parameters for dump tiddler command";
}
var tiddler = this.commander.wiki.getTiddler(this.params[1]);
if(!tiddler) {
return "No such tiddler as '" + this.params[1] + "'";
}
this.output.write("Tiddler '" + this.params[1] + "' contains these fields:\n");
for(var t in tiddler.fields) {
this.output.write(" " + t + ": " + tiddler.getFieldString(t) + "\n");