re-add nil receiver for ModeSet.HasMode

This commit is contained in:
Shivaram Lingamneni 2018-08-23 10:30:28 -04:00
parent 1fd63672f3
commit 86836905b3
2 changed files with 6 additions and 1 deletions

View file

@ -341,6 +341,10 @@ func NewModeSet() *ModeSet {
// test whether `mode` is set
func (set *ModeSet) HasMode(mode Mode) bool {
if set == nil {
return false
}
return utils.BitsetGet(set[:], uint(mode)-minMode)
}