diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index af1dc06bba93a586398e4969925514e3ea66fe79..e8324ddf1968f2bb2e0287dc65ae8e278efd606a 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -89,6 +89,9 @@ static char* get_value(FILE* fp, const char* section, const char* key)
 	char	str[MAX_LINE_LEN];
 	static char value[MAX_VALUE_LEN];
 
+	if(fp==NULL)
+		return(NULL);
+
 	if(!find_section(fp,section))
 		return(NULL);