Regarding to documentation on  function `g_key_file_to_data`:

> Note that this function never reports an error, so it is safe to pass NULL as error. 

So it's ok to remove dead code.