Fix for crashed shared contents

Fix for : 
Issue #131 &  Issue #132 : 
Crash when sharing contents from other apps to ownCloud