Fixed potential segfault when saving selected robot model