Skip to content

Commit

Permalink
KOTOR: Fix usage of dynamic_cast<>()
Browse files Browse the repository at this point in the history
dynamic_cast<>() to a pointer may return 0, which has
to be checked for.
dynamic_cast<>() to a reference may throw an exception instead.

Coverity issue 1038265.
  • Loading branch information
DrMcCoy committed Jun 26, 2013
1 parent 3d918ab commit 3b5c484
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engines/kotor/gui/main/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void OptionsMenu::callbackActive(Widget &widget) {
}

void OptionsMenu::adoptChanges() {
dynamic_cast<OptionsGameplayMenu*>(_gameplay)->adoptChanges();
dynamic_cast<OptionsGameplayMenu &>(*_gameplay).adoptChanges();
}


Expand Down

0 comments on commit 3b5c484

Please sign in to comment.