document: use return_val_if_fail
editor: fix a warning