diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -109,6 +109,10 @@ SteamUser.prototype.setOptions = function(options) {
 };
 
 function checkDirExists(dir) {
+	if(!dir) {
+		return;
+	}
+
 	var path = '';
 	dir.replace(/\\/g, '/').split('/').forEach(function(dir, index) {
 		if(index === 0 && !dir) {
Fixed crash when dataDirectory is null in constructor