codec: fixed potential crash in NSCodec implementation
Merge pull request #1009 from mfleisz/fixnsc

codec: fixed potential crash in NSCodec implementation