Test the size of ptr with get-size(ptr). Only if it is bigger than 0, try following : message get-string(ptr,1,5) --> get the first 5 bytes of your memptr (only if size allows this, if size is only 4 byte, then get-string(ptr,1,4)...
To assure you have something in the ptr.