Fix warning, also added error message for the case of no filename passed.
authorAndrea Weikert <elubie@gmx.net>
Fri, 16 Apr 2010 05:24:58 +0000 (05:24 +0000)
committerAndrea Weikert <elubie@gmx.net>
Fri, 16 Apr 2010 05:24:58 +0000 (05:24 +0000)
source/blender/windowmanager/intern/wm_files.c

index 7e309b9c8769326c3ccca9bfffcefc4fd578a803..b6126da33a23f279fe32cb04e29550a31bec1dc1 100644 (file)
@@ -491,7 +491,11 @@ int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
        
        len = strlen(target);
        
-       if (len == 0) return;
+       if (len == 0) {
+               BKE_report(reports, RPT_ERROR, "Path is empty, cannot save");
+               return -1;
+       }
+
        if (len >= FILE_MAX) {
                BKE_report(reports, RPT_ERROR, "Path too long, cannot save");
                return -1;