Bug 784783 Don't access [NSEvent characters] if the event type is neither NSKeyDown nor NSKeyUp r=smichaud

This commit is contained in:
Masayuki Nakano 2012-08-31 12:55:23 +09:00
parent 78431d63a5
commit 42c33fcf7c

View File

@ -712,6 +712,12 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent,
UInt32 nativeKeyCode = [aNativeKeyEvent keyCode];
bool isPrintableKey = !TextInputHandler::IsSpecialGeckoKey(nativeKeyCode);
if (isPrintableKey &&
[aNativeKeyEvent type] != NSKeyDown &&
[aNativeKeyEvent type] != NSKeyUp)) {
NS_WARNING("Why the printable key doesn't cause NSKeyDown or NSKeyUp?");
isPrintableKey = false;
}
// Decide what string will be input.
nsAutoString insertString;