return workstation not found even if the results is a JSON NULL. free the NULL object
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 11 Aug 2008 15:11:35 +0000 (15:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 11 Aug 2008 15:11:35 +0000 (15:11 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10331 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_auth.c

index 59ff65d..0dd9805 100644 (file)
@@ -320,7 +320,10 @@ static oilsEvent* oilsAuthVerifyWorkstation(
                const osrfMethodContext* ctx, jsonObject* userObj, const char* ws ) {
        osrfLogInfo(OSRF_LOG_MARK, "Attaching workstation to user at login: %s", ws);
        jsonObject* workstation = oilsUtilsFetchWorkstationByName(ws);
-       if(!workstation) return oilsNewEvent(OSRF_LOG_MARK, "WORKSTATION_NOT_FOUND");
+       if(!workstation || workstation->type == JSON_NULL) {
+        jsonObjectFree(workstation);
+        return oilsNewEvent(OSRF_LOG_MARK, "WORKSTATION_NOT_FOUND");
+    }
        long wsid = oilsFMGetObjectId(workstation);
        LONG_TO_STRING(wsid);
        char* orgid = oilsFMGetString(workstation, "owning_lib");