fixed a bug cause crash

when view attach status change
Merge pull request #13 from pur2evil/master

fixed a bug cause crash