- check for null property before trying to copy properties
This commit is contained in:
parent
46b82360b0
commit
86b7f1b26a
1 changed files with 7 additions and 3 deletions
|
@ -133,7 +133,8 @@ void
|
||||||
FGBinding::fire (double setting) const
|
FGBinding::fire (double setting) const
|
||||||
{
|
{
|
||||||
SGPropertyNode arg;
|
SGPropertyNode arg;
|
||||||
copyProperties(_arg, &arg);
|
if (_arg != 0)
|
||||||
|
copyProperties(_arg, &arg);
|
||||||
arg.setDoubleValue("setting", setting);
|
arg.setDoubleValue("setting", setting);
|
||||||
_fire(&arg);
|
_fire(&arg);
|
||||||
}
|
}
|
||||||
|
@ -199,6 +200,9 @@ FGInput::update ()
|
||||||
void
|
void
|
||||||
FGInput::doKey (int k, int modifiers, int x, int y)
|
FGInput::doKey (int k, int modifiers, int x, int y)
|
||||||
{
|
{
|
||||||
|
SG_LOG(SG_INPUT, SG_INFO, "User pressed key " << k
|
||||||
|
<< " with modifiers " << modifiers);
|
||||||
|
|
||||||
// Sanity check.
|
// Sanity check.
|
||||||
if (k < 0 || k >= MAX_KEYS) {
|
if (k < 0 || k >= MAX_KEYS) {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Key value " << k << " out of range");
|
SG_LOG(SG_INPUT, SG_ALERT, "Key value " << k << " out of range");
|
||||||
|
@ -209,8 +213,8 @@ FGInput::doKey (int k, int modifiers, int x, int y)
|
||||||
|
|
||||||
// Key pressed.
|
// Key pressed.
|
||||||
if (modifiers&FG_MOD_UP == 0) {
|
if (modifiers&FG_MOD_UP == 0) {
|
||||||
// SG_LOG(SG_INPUT, SG_INFO, "User pressed key " << k
|
// SG_LOG( SG_INPUT, SG_INFO, "User pressed key " << k
|
||||||
// << " with modifiers " << modifiers);
|
// << " with modifiers " << modifiers );
|
||||||
if (!b.last_state || b.is_repeatable) {
|
if (!b.last_state || b.is_repeatable) {
|
||||||
const binding_list_t &bindings =
|
const binding_list_t &bindings =
|
||||||
_find_key_bindings(k, modifiers);
|
_find_key_bindings(k, modifiers);
|
||||||
|
|
Loading…
Reference in a new issue