From abdce8ddacc3f76cb9d67cd74ebde24691cee5cd Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 24 Feb 2020 21:10:16 -0600 Subject: [PATCH] Don't crash on loss of target for ACT_READ This can occur if the book an NPC is reading is removed from their inventory. --- src/activity_handlers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index f170f6c0be48d..de83bd6f4b21b 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -2980,6 +2980,7 @@ void activity_handlers::read_finish( player_activity *act, player *p ) { if( !act->targets.front() ) { debugmsg( "Lost target of ACT_READ" ); + return; } if( p->is_npc() ) { npc *guy = dynamic_cast( p );