bugfix: 修正特定条件下segfault